#include "p4api.h" #include "p4connection.h" QObject* P4Api::_newConnection(QVariantMap config) { QString conName; if (config.keys().contains("port")) conName = config.value("port").toString(); else return NULL; if (config.keys().contains("user")) conName += ", " + config.value("user").toString(); if (config.keys().contains("client")) if (config.value("client").toString().length()>0) conName += ", " + config.value("client").toString(); if (m_ConnectionNames.contains(conName)) return m_Connections.value(m_ConnectionNames.indexOf(conName)); P4Connection* newCon = new P4Connection(config,conName,this); m_ConnectionNames.append(conName); m_Connections.append(newCon); return newCon; } QObject* P4Api::getConnection(QString key) { if (m_ConnectionNames.contains(key)) { int index = m_ConnectionNames.indexOf(key); return m_Connections.at(index); } else return NULL; } void P4Api::destroyConnection(QString key) { if (m_ConnectionNames.contains(key)) { int index = m_ConnectionNames.indexOf(key); QObject* doomedConnection = m_Connections.takeAt(index); QString doomedConnectionName = m_ConnectionNames.takeAt(index); delete doomedConnection; delete &doomedConnectionName; } } QObjectList P4Api::getConnections() { return m_Connections; } QStringList P4Api::getConnectionNames() { return m_ConnectionNames; }
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#2 | 8115 | David George |
a bunch of changes to the GuiApi - probably bound to change, though, so use at your own risk! beginnings of migrating to an "all windows are created equal" model. (as opposed to a MainWindow) removing the unreliable Qt execution of the .js methods - please include in your HTML (<script type="text/javascript" src="qrc:/js/ClientKitMethods.js"></script>) |
||
#1 | 8101 | David George |
beginning of _massive_ re-factoring your current build settings will fail create a new project from newly added .pro file (but change its p4api paths to match your old one) look for updated README as soon as Dave agrees that changes are _indeed_ for the best (Changes by Jaimen) |