From 4be2513b86decea7720f930164b4e893b63e53e0 Mon Sep 17 00:00:00 2001 From: Sebastian Goth Date: Thu, 17 Jul 2008 00:30:56 +0200 Subject: [PATCH] Adopted --debugbufferswitches and --debugmodel to cliparser. --- src/client/buffermodel.cpp | 4 +++- src/client/treemodel.cpp | 3 ++- src/common/main.cpp | 2 ++ 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/client/buffermodel.cpp b/src/client/buffermodel.cpp index b67a447d..a03ae5bd 100644 --- a/src/client/buffermodel.cpp +++ b/src/client/buffermodel.cpp @@ -23,6 +23,8 @@ #include "networkmodel.h" #include "mappedselectionmodel.h" #include "buffer.h" +#include "global.h" + #include BufferModel::BufferModel(NetworkModel *parent) @@ -30,7 +32,7 @@ BufferModel::BufferModel(NetworkModel *parent) _selectionModelSynchronizer(this) { setSourceModel(parent); - if(QCoreApplication::instance()->arguments().contains("--debugbufferswitches")) { + if(Global::parser.isSet("debugbufferswitches")) { connect(_selectionModelSynchronizer.selectionModel(), SIGNAL(currentChanged(const QModelIndex &, const QModelIndex &)), this, SLOT(debug_currentChanged(const QModelIndex &, const QModelIndex &))); } diff --git a/src/client/treemodel.cpp b/src/client/treemodel.cpp index c61cf9e8..2a71576d 100644 --- a/src/client/treemodel.cpp +++ b/src/client/treemodel.cpp @@ -19,6 +19,7 @@ ***************************************************************************/ #include "treemodel.h" +#include "global.h" #include #include @@ -317,7 +318,7 @@ TreeModel::TreeModel(const QList &data, QObject *parent) rootItem = new SimpleTreeItem(data, 0); connectItem(rootItem); - if(QCoreApplication::instance()->arguments().contains("--debugmodel")) { + if(Global::parser.isSet("debugmodel")) { connect(this, SIGNAL(rowsAboutToBeInserted(const QModelIndex &, int, int)), this, SLOT(debug_rowsAboutToBeInserted(const QModelIndex &, int, int))); connect(this, SIGNAL(rowsAboutToBeRemoved(const QModelIndex &, int, int)), diff --git a/src/common/main.cpp b/src/common/main.cpp index f51f6b2c..bac43084 100644 --- a/src/common/main.cpp +++ b/src/common/main.cpp @@ -89,6 +89,8 @@ int main(int argc, char **argv) { #endif // BUILD_QTUI #ifndef BUILD_CORE // put client-only arguments here + Global::parser.addSwitch("debugbufferswitches",0,"Enables debugging for bufferswitches"); + Global::parser.addSwitch("debugmodel",0,"Enables debugging for models"); #endif // BUILD_QTCORE // put shared client&core arguments here Global::parser.addSwitch("debug",'d',"Enable debug output"); -- 2.20.1