Skip to content

Commit

Permalink
Remove commented out code.
Browse files Browse the repository at this point in the history
  • Loading branch information
ahmedcharles committed Apr 17, 2017
1 parent 953cfaa commit de64759
Show file tree
Hide file tree
Showing 13 changed files with 0 additions and 384 deletions.
4 changes: 0 additions & 4 deletions src/ActionUnit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -423,12 +423,10 @@ TAction * ActionUnit::getHeadAction( TToolBar * pT )
{
for(auto & action : mActionRootNodeList)
{
// N/U: bool found = false;
for(auto it2 = mToolBarList.begin(); it2!=mToolBarList.end(); it2++ )
{
if( pT == action->mpToolBar )
{
// N/U: found = true;
return action;
}
}
Expand Down Expand Up @@ -514,12 +512,10 @@ TAction * ActionUnit::getHeadAction( TEasyButtonBar * pT )
{
for(auto & action : mActionRootNodeList)
{
// N/U: bool found = false;
for(auto it2 = mEasyButtonBarList.begin(); it2!=mEasyButtonBarList.end(); it2++ )
{
if( pT == action->mpEasyButtonBar )
{
// N/U: found = true;
return action;
}
}
Expand Down
56 changes: 0 additions & 56 deletions src/HostManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,28 +60,6 @@ bool HostManager::deleteHost( QString hostname )
}
}

// Not Used - if resurrected MUST re-write to use mPoolReadWriteLock.lockForWrite() as in deleteHost(...)/addHost(...)!
//bool HostManager::renameHost( QString hostname )
//{
// QMutexLocker locker(& mPoolLock);

// // make sure this is really a new host
// if( mHostPool.find( hostname ) == mHostPool.end() )
// {
// return false;
// }
// else
// {
// //Host * pNewHost = getHost( hostname ); // see why it doesn't work
// QSharedPointer<Host> pNewHost = mHostPool[hostname];
// mHostPool.remove( hostname );
// mHostPool.insert(pNewHost->getName(), pNewHost);
// }

// return true;

//}

bool HostManager::addHost( QString hostname, QString port, QString login, QString pass )
{
if( hostname.isEmpty() )
Expand Down Expand Up @@ -123,7 +101,6 @@ bool HostManager::addHost( QString hostname, QString port, QString login, QStrin
}

mHostPool.insert( hostname, pNewHost );
// Not Used: mpActiveHost = mHostPool.begin().value().data();
mPoolReadWriteLock.unlock();
qDebug() << "HostManager::addHost(" << hostname.toUtf8().constData() << ") INFO: new Host created and added to host pool... releasing lock and returning true!";
return true;
Expand All @@ -145,15 +122,6 @@ QStringList HostManager::getHostList()
return strlist;
}

// Not Used - if resurrected MUST re-write to use mPoolReadWriteLock.lockForRead()
// and take a const local copy of mHostPool.keys() to return!
//QList<QString> HostManager::getHostNameList()
//{
// QMutexLocker locker(& mPoolLock);

// return mHostPool.keys();
//}

void HostManager::postIrcMessage( QString a, QString b, QString c )
{
qDebug() << "HostManager::postIrcMessage(...) INFO: trying to read host pool, getting shared read access...";
Expand Down Expand Up @@ -236,27 +204,3 @@ Host * HostManager::getHost( QString hostname )

return pHost;
}

// Not Used:
//Host * HostManager::getHostFromHostID( int id )
//{
// QMutexLocker locker( & mPoolLock );
// QMapIterator<QString, QSharedPointer<Host> > it(mHostPool);
// while( it.hasNext() )
// {
// it.next();
// if( it.value()->getHostID() == id )
// {
// return it.value().data();
// }
// }
// qDebug()<<"ERROR: didnt find requested id in hostpool";
// return 0;
//}

// Not Used:
//Host * HostManager::getFirstHost()
//{
// QMutexLocker locker(& mPoolLock);
// return mHostPool.begin().value().data();
//}
5 changes: 0 additions & 5 deletions src/HostManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,19 +43,14 @@ class HostManager
HostManager() /* : mpActiveHost() - Not needed */ {}
Host* getHost(QString hostname);
QStringList getHostList();
// Not Used: QList<QString> getHostNameList();
// Not Used: Host * getFirstHost();
bool addHost(QString name, QString port, QString login, QString pass);
bool deleteHost(QString);
// Not Used: bool renameHost( QString );
// Not Used: Host * getHostFromHostID( int id );
void postIrcMessage(QString, QString, QString);
void postInterHostEvent(const Host*, const TEvent&);

private:
QReadWriteLock mPoolReadWriteLock; // Was QMutex, but we needed to allow concurrent read access
QMap<QString, QSharedPointer<Host>> mHostPool;
// Not Used: Host * mpActiveHost;
};

#endif // MUDLET_HOSTMANAGER_H
1 change: 0 additions & 1 deletion src/T2DMap.h
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,6 @@ class T2DMap : public QWidget
int mFontHeight;
bool mShowRoomID;
QMap<int, QPixmap> mPixMap;
// QMap<int, QPixmap > mGridPix;
int gzoom;
double rSize;
double eSize;
Expand Down
4 changes: 0 additions & 4 deletions src/TBuffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,7 @@ class TChar
int bgG;
int bgB;
unsigned flags;
// bool italics;
// bool bold;
// bool underline;
int link;
// bool invers;
};

const QChar cLF = QChar('\n');
Expand Down
1 change: 0 additions & 1 deletion src/TCommandLine.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ class TCommandLine : public QPlainTextEdit //QLineEdit
public:
TCommandLine(Host*, TConsole*, QWidget*);
~TCommandLine();
// void keyPressEvent(QKeyEvent *event);
void focusInEvent(QFocusEvent*) override;
void focusOutEvent(QFocusEvent*) override;
QPalette mRegularPalette;
Expand Down
137 changes: 0 additions & 137 deletions src/TLuaInterpreter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,18 +91,6 @@ TLuaInterpreter::TLuaInterpreter( Host * pH, int id )
{
pGlobalLua = 0;

// Not Used: connect(this, SIGNAL(signalEchoMessage(int, QString)), this, SLOT(slotEchoMessage(int, QString)));
// Not Used: connect(this, SIGNAL(signalNewCommand(int, QString)), this, SLOT(slotNewCommand(int, QString)));

// Not Used: connect(this, SIGNAL(signalOpenUserWindow(int, QString)), this, SLOT(slotOpenUserWindow(int, QString)));
// Not Used: connect(this, SIGNAL(signalEchoUserWindow(int, QString, QString)), this, SLOT(slotEchoUserWindow(int, QString, QString)));
// Not Used: connect(this, SIGNAL(signalEnableTimer(int, QString)), this, SLOT(slotEnableTimer(int, QString)));
// Not Used: connect(this, SIGNAL(signalDisableTimer(int, QString)), this, SLOT(slotDisableTimer(int, QString)));
// Not Used: connect(this, SIGNAL(signalClearUserWindow(int, QString)), this, SLOT(slotClearUserWindow(int, QString)));

// Not Used: connect(this, SIGNAL(signalTempTimer(int, double, QString, QString)), this, SLOT(slotTempTimer(int, double, QString, QString)));
// Not Used: connect(this, SIGNAL(signalReplace(int, QString)), this, SLOT(slotReplace(int, QString)));

connect(&purgeTimer, SIGNAL(timeout()), this, SLOT(slotPurge()));

mpFileDownloader = new QNetworkAccessManager( this );
Expand All @@ -118,25 +106,6 @@ TLuaInterpreter::~TLuaInterpreter()
lua_close(pGlobalLua);
}

// Not Used:
//lua_State * TLuaInterpreter::getLuaExecutionUnit( int unit )
//{
// switch( unit )
// {
// case 1:
// return pGlobalLua;
// case 2:
// return pGlobalLua;
// case 3:
// return pGlobalLua;
// case 4:
// return pGlobalLua;
// case 5:
// return pGlobalLua;
// };
// return 0;
//}

// Previous code didn't tell the Qt libraries when we had finished with a
// QNetworkReply so all the data downloaded would be held in memory until the
// profile was closed - importantly the documentation for the signal
Expand Down Expand Up @@ -13032,47 +13001,8 @@ int TLuaInterpreter::check_for_mappingscript()
return r;
}

// Not Used:
//void TLuaInterpreter::threadLuaInterpreterExec( string code )
//{
// /* cout << "TLuaMainThread::threadLuaInterpreterExec(code) executing following code:" << endl;
// cout << "--------------------------------------------snip<" <<endl;
// cout << code << endl;
// cout << ">snip--------------------------------------------" <<endl;*/
// lua_State * L = pGlobalLua;
// int error = luaL_dostring(L,code.c_str());
// QString n;
// if( error != 0 )
// {
// string e = "no error message available from Lua";
// if( lua_isstring( L, 1 ) )
// {
// e = "Lua error:";
// e += lua_tostring( L, 1 );
// }
// emit signalEchoMessage( mHostID, QString( e.c_str() ) );
// qDebug()<< "LUA_ERROR:"<<e.c_str();
// }

// cout << "cRunningScript::threadLuaInterpreterExec() done" << endl;
//}



void TLuaInterpreter::startLuaSessionInterpreter()
{
//connect(this,SIGNAL(signalOpenWindow(int,QString)), this,SLOT(slotOpenWindow(int,QString)));
//connect(this,SIGNAL(signalEchoWindow(int,QString,QString)), this,SLOT(slotEchoWindow(int,QString,QString)));
//connect(this,SIGNAL(signalClearWindow(int,QString)), this,SLOT(slotClearWindow(int,QString)));
//connect(this,SIGNAL(signalNewTrigger(QString,QString, int, QString)), this,SLOT(slotNewTrigger(QString,QString, int, QString)));
//connect(this,SIGNAL(signalAddTimer(int,int,QString,QString)),this,SLOT(slotAddTimer(int,int,QString,QString)));
//connect(this,SIGNAL(signalDeleteTrigger(int,QString)), this,SLOT(slotDeleteTrigger(int,QString)));


//connect(this,SIGNAL(signalEchoMessage(int,QString)), this,SLOT(slotEchoMessage(int,QString)));//,Qt::DirectConnection);
//connect(this,SIGNAL(signalNewEcho(int,QString)), this,SLOT(slotNewEcho(int,QString)));
//connect(this,SIGNAL(signalNewCommand(int,QString)), this,SLOT(slotNewCommand(int,QString)));//,Qt::QueuedConnection);

mpLuaSessionThread = new TLuaMainThread(this);
mpLuaSessionThread->start(); //calls initLuaGlobals() to initialize the interpreter for this session
}
Expand Down Expand Up @@ -13623,73 +13553,6 @@ void TLuaInterpreter::loadGlobal()
}
}

// Not Used:
//void TLuaInterpreter::slotEchoMessage(int hostID, const QString& msg)
//{
// Host * pHost = mudlet::self()->getHostManager()->getHostFromHostID( hostID );
// mudlet::self()->print( pHost, msg );
//}

// Not Used:
//void TLuaInterpreter::slotNewCommand(int hostID, const QString& cmd)
//{
// Host * pHost = mudlet::self()->getHostManager()->getHostFromHostID( hostID );
// pHost->send( cmd );
//}

// Not Used:
//void TLuaInterpreter::slotOpenUserWindow(int hostID, const QString& windowName )
//{
//}

// Not Used:
//void TLuaInterpreter::slotClearUserWindow(int hostID, const QString& windowName )
//{
//}

// Not Used:
//void TLuaInterpreter::slotEnableTimer(int hostID, const QString& windowName )
//{
// Host * pHost = mudlet::self()->getHostManager()->getHostFromHostID( hostID );
// pHost->enableTimer( windowName );
//}

// Not Used:
//void TLuaInterpreter::slotDisableTimer(int hostID, const QString& windowName )
//{
// Host * pHost = mudlet::self()->getHostManager()->getHostFromHostID( hostID );
// pHost->disableTimer( windowName );
//}

// Not Used:
//void TLuaInterpreter::slotReplace(int hostID, const QString& text)
//{
//}

// Not Used:
//void TLuaInterpreter::slotEchoUserWindow(int hostID, const QString& windowName, const QString& text )
//{
//}

// Not Used:
//void TLuaInterpreter::slotTempTimer( int hostID, double timeout, const QString& function, const QString& timerName )
//{
// Host * pHost = mudlet::self()->getHostManager()->getHostFromHostID( hostID );
// QTime time(0,0,0,0);
// int msec = static_cast<int>(timeout * 1000);
// QTime time2 = time.addMSecs( msec );
// TTimer * pT;
// pT = new TTimer( timerName, time2, pHost );
// pT->setName( timerName );
// pT->setTime( time2 );
// //qDebug()<<"setting time of tempTimer to "<<time2.minute()<<":"<<time2.second()<<":"<<time2.msec()<<" timeout="<<timeout;
// pT->setScript( function );
// pT->setIsFolder( false );
// pT->setIsActive( true );
// pT->setIsTempTimer( true );
// pT->registerTimer();
//}

int TLuaInterpreter::startPermTimer(const QString & name, const QString & parent, double timeout, const QString & function )
{
QTime time( 0, 0, 0, 0 );
Expand Down
Loading

0 comments on commit de64759

Please sign in to comment.