summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDominik Haumann <dhaumann@kde.org>2014-01-19 19:17:30 (GMT)
committerDominik Haumann <dhaumann@kde.org>2014-01-19 19:17:30 (GMT)
commitf743187951e5924d4b8b166e9ad6416a9e7af9e6 (patch)
treed54d91d0e97e083b4ca6f5f612f7302d9e7126ae
parentdad4ca3a6f35ecebe7d9a0ab41c754744f711348 (diff)
run astyle with kdelibs coding style
astyle -n -Q \ --indent=spaces=4 --style=otbs \ --indent-labels --pad-oper --unpad-paren --pad-header \ --keep-one-line-statements \ --convert-tabs \ --indent-preprocessor \ --align-pointer=name \ *.h *.cpp
-rw-r--r--addons/kate/backtracebrowser/btdatabase.cpp94
-rw-r--r--addons/kate/backtracebrowser/btdatabase.h16
-rw-r--r--addons/kate/backtracebrowser/btfileindexer.cpp86
-rw-r--r--addons/kate/backtracebrowser/btfileindexer.h22
-rw-r--r--addons/kate/backtracebrowser/btparser.cpp240
-rw-r--r--addons/kate/backtracebrowser/btparser.h32
-rw-r--r--addons/kate/backtracebrowser/katebacktracebrowser.cpp442
-rw-r--r--addons/kate/backtracebrowser/katebacktracebrowser.h82
8 files changed, 509 insertions, 505 deletions
diff --git a/addons/kate/backtracebrowser/btdatabase.cpp b/addons/kate/backtracebrowser/btdatabase.cpp
index 433759b..8778f56 100644
--- a/addons/kate/backtracebrowser/btdatabase.cpp
+++ b/addons/kate/backtracebrowser/btdatabase.cpp
@@ -1,5 +1,5 @@
/* This file is part of the KDE project
- Copyright 2008 Dominik Haumann <dhaumann kde org>
+ Copyright 2008-2014 Dominik Haumann <dhaumann kde org>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
@@ -24,69 +24,69 @@
#include <QDebug>
-void KateBtDatabase::loadFromFile(const QString& url)
+void KateBtDatabase::loadFromFile(const QString &url)
{
- QFile file(url);
- if (file.open(QIODevice::ReadOnly)) {
- QMutexLocker locker(&mutex);
- QDataStream ds(&file);
- ds >> db;
- }
- qDebug() << "Number of entries in the backtrace database:" << db.size();
+ QFile file(url);
+ if (file.open(QIODevice::ReadOnly)) {
+ QMutexLocker locker(&mutex);
+ QDataStream ds(&file);
+ ds >> db;
+ }
+ qDebug() << "Number of entries in the backtrace database:" << db.size();
}
-void KateBtDatabase::saveToFile(const QString& url) const
+void KateBtDatabase::saveToFile(const QString &url) const
{
- QFile file(url);
- if (file.open(QIODevice::WriteOnly)) {
- QMutexLocker locker(&mutex);
- QDataStream ds(&file);
- ds << db;
- }
+ QFile file(url);
+ if (file.open(QIODevice::WriteOnly)) {
+ QMutexLocker locker(&mutex);
+ QDataStream ds(&file);
+ ds << db;
+ }
}
-QString KateBtDatabase::value(const QString& key)
+QString KateBtDatabase::value(const QString &key)
{
- // key is either of the form "foo/bar.txt" or only "bar.txt"
- QString file = key;
- QStringList sl = key.split(QLatin1Char('/'));
- if (sl.size() > 1) {
- file = sl[1];
- }
-
- QMutexLocker locker(&mutex);
- if (db.contains(file)) {
- const QStringList& sl = db.value(file);
- for (int i = 0; i < sl.size(); ++i) {
- if (sl[i].indexOf(key) != -1) {
- return sl[i];
- }
+ // key is either of the form "foo/bar.txt" or only "bar.txt"
+ QString file = key;
+ QStringList sl = key.split(QLatin1Char('/'));
+ if (sl.size() > 1) {
+ file = sl[1];
}
- // try to use the first one
- if (sl.size() > 0) {
- return sl[0];
+
+ QMutexLocker locker(&mutex);
+ if (db.contains(file)) {
+ const QStringList &sl = db.value(file);
+ for (int i = 0; i < sl.size(); ++i) {
+ if (sl[i].indexOf(key) != -1) {
+ return sl[i];
+ }
+ }
+ // try to use the first one
+ if (sl.size() > 0) {
+ return sl[0];
+ }
}
- }
- return QString();
+ return QString();
}
-void KateBtDatabase::add(const QString& folder, const QStringList& files)
+void KateBtDatabase::add(const QString &folder, const QStringList &files)
{
- QMutexLocker locker(&mutex);
- foreach (const QString& file, files) {
- QStringList& sl = db[file];
- QString entry = QDir::fromNativeSeparators(folder + QLatin1Char('/') + file);
- if (!sl.contains(entry)) {
- sl << entry;
+ QMutexLocker locker(&mutex);
+ foreach(const QString & file, files) {
+ QStringList &sl = db[file];
+ QString entry = QDir::fromNativeSeparators(folder + QLatin1Char('/') + file);
+ if (!sl.contains(entry)) {
+ sl << entry;
+ }
}
- }
}
int KateBtDatabase::size() const
{
- QMutexLocker locker(&mutex);
- return db.size();
+ QMutexLocker locker(&mutex);
+ return db.size();
}
-// kate: space-indent on; indent-width 2; replace-tabs on;
+// kate: space-indent on; indent-width 4; replace-tabs on;
diff --git a/addons/kate/backtracebrowser/btdatabase.h b/addons/kate/backtracebrowser/btdatabase.h
index 372490b..36b6b39 100644
--- a/addons/kate/backtracebrowser/btdatabase.h
+++ b/addons/kate/backtracebrowser/btdatabase.h
@@ -1,5 +1,5 @@
/* This file is part of the KDE project
- Copyright 2008 Dominik Haumann <dhaumann kde org>
+ Copyright 2008-2014 Dominik Haumann <dhaumann kde org>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
@@ -26,24 +26,24 @@
class KateBtDatabase
{
- public:
+public:
KateBtDatabase() {}
~KateBtDatabase() {}
- void loadFromFile(const QString& url);
- void saveToFile(const QString& url) const;
+ void loadFromFile(const QString &url);
+ void saveToFile(const QString &url) const;
- QString value(const QString& key);
+ QString value(const QString &key);
- void add(const QString& folder, const QStringList& files);
+ void add(const QString &folder, const QStringList &files);
int size() const;
- private:
+private:
mutable QMutex mutex;
QHash<QString, QStringList> db;
};
#endif //KATE_BACKTRACEDB_H
-// kate: space-indent on; indent-width 2; replace-tabs on;
+// kate: space-indent on; indent-width 4; replace-tabs on;
diff --git a/addons/kate/backtracebrowser/btfileindexer.cpp b/addons/kate/backtracebrowser/btfileindexer.cpp
index 6e11b59..82b0519 100644
--- a/addons/kate/backtracebrowser/btfileindexer.cpp
+++ b/addons/kate/backtracebrowser/btfileindexer.cpp
@@ -1,5 +1,5 @@
/* This file is part of the KDE project
- Copyright 2008 Dominik Haumann <dhaumann kde org>
+ Copyright 2008-2014 Dominik Haumann <dhaumann kde org>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
@@ -22,10 +22,10 @@
#include <QDir>
#include <QDebug>
-BtFileIndexer::BtFileIndexer(KateBtDatabase* database)
- : QThread()
- , cancelAsap(false)
- , db(database)
+BtFileIndexer::BtFileIndexer(KateBtDatabase *database)
+ : QThread()
+ , cancelAsap(false)
+ , db(database)
{
}
@@ -33,57 +33,61 @@ BtFileIndexer::~BtFileIndexer()
{
}
-void BtFileIndexer::setSearchPaths(const QStringList& urls)
+void BtFileIndexer::setSearchPaths(const QStringList &urls)
{
- searchPaths.clear();
- foreach (const QString& url, urls) {
- if (!searchPaths.contains(url)) {
- searchPaths += url;
+ searchPaths.clear();
+ foreach(const QString & url, urls) {
+ if (!searchPaths.contains(url)) {
+ searchPaths += url;
+ }
}
- }
}
-void BtFileIndexer::setFilter(const QStringList& fileFilter)
+void BtFileIndexer::setFilter(const QStringList &fileFilter)
{
- filter = fileFilter;
- qDebug() << filter;
+ filter = fileFilter;
+ qDebug() << filter;
}
void BtFileIndexer::run()
{
- if (filter.size() == 0) {
- qDebug() << "Filter is empty. Aborting.";
- return;
- }
-
- cancelAsap = false;
- for (int i = 0; i < searchPaths.size(); ++i) {
- if (cancelAsap) { break; }
- indexFiles(searchPaths[i]);
- }
- qDebug() << QStringLiteral("Backtrace file database contains %1 files").arg(db->size());
+ if (filter.size() == 0) {
+ qDebug() << "Filter is empty. Aborting.";
+ return;
+ }
+
+ cancelAsap = false;
+ for (int i = 0; i < searchPaths.size(); ++i) {
+ if (cancelAsap) {
+ break;
+ }
+ indexFiles(searchPaths[i]);
+ }
+ qDebug() << QStringLiteral("Backtrace file database contains %1 files").arg(db->size());
}
void BtFileIndexer::cancel()
{
- cancelAsap = true;
+ cancelAsap = true;
}
-void BtFileIndexer::indexFiles(const QString& url)
+void BtFileIndexer::indexFiles(const QString &url)
{
- QDir dir(url);
- if (!dir.exists()) {
- return;
- }
-
- QStringList files = dir.entryList(filter, QDir::Files | QDir::NoSymLinks | QDir::Readable | QDir::NoDotAndDotDot | QDir::CaseSensitive);
- db->add(url, files);
-
- QStringList subdirs = dir.entryList(QDir::Dirs | QDir::NoSymLinks | QDir::Readable | QDir::NoDotAndDotDot | QDir::CaseSensitive);
- for (int i = 0; i < subdirs.size(); ++i) {
- if (cancelAsap) { break; }
- indexFiles(url + QLatin1Char('/') + subdirs[i]);
- }
+ QDir dir(url);
+ if (!dir.exists()) {
+ return;
+ }
+
+ QStringList files = dir.entryList(filter, QDir::Files | QDir::NoSymLinks | QDir::Readable | QDir::NoDotAndDotDot | QDir::CaseSensitive);
+ db->add(url, files);
+
+ QStringList subdirs = dir.entryList(QDir::Dirs | QDir::NoSymLinks | QDir::Readable | QDir::NoDotAndDotDot | QDir::CaseSensitive);
+ for (int i = 0; i < subdirs.size(); ++i) {
+ if (cancelAsap) {
+ break;
+ }
+ indexFiles(url + QLatin1Char('/') + subdirs[i]);
+ }
}
-// kate: space-indent on; indent-width 2; replace-tabs on;
+// kate: space-indent on; indent-width 4; replace-tabs on;
diff --git a/addons/kate/backtracebrowser/btfileindexer.h b/addons/kate/backtracebrowser/btfileindexer.h
index 2dd4e5f..af2d0dd 100644
--- a/addons/kate/backtracebrowser/btfileindexer.h
+++ b/addons/kate/backtracebrowser/btfileindexer.h
@@ -1,5 +1,5 @@
/* This file is part of the KDE project
- Copyright 2008 Dominik Haumann <dhaumann kde org>
+ Copyright 2008-2014 Dominik Haumann <dhaumann kde org>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
@@ -27,28 +27,28 @@ class KateBtDatabase;
class BtFileIndexer : public QThread
{
- Q_OBJECT
- public:
- BtFileIndexer(KateBtDatabase* db);
+ Q_OBJECT
+public:
+ BtFileIndexer(KateBtDatabase *db);
virtual ~BtFileIndexer();
- void setSearchPaths(const QStringList& urls);
+ void setSearchPaths(const QStringList &urls);
- void setFilter(const QStringList& filter);
+ void setFilter(const QStringList &filter);
void cancel();
- protected:
+protected:
virtual void run();
- void indexFiles(const QString& url);
+ void indexFiles(const QString &url);
- private:
+private:
bool cancelAsap;
QStringList searchPaths;
QStringList filter;
- KateBtDatabase* db;
+ KateBtDatabase *db;
};
#endif
-// kate: space-indent on; indent-width 2; replace-tabs on;
+// kate: space-indent on; indent-width 4; replace-tabs on;
diff --git a/addons/kate/backtracebrowser/btparser.cpp b/addons/kate/backtracebrowser/btparser.cpp
index ee34e2d..db8c7d7 100644
--- a/addons/kate/backtracebrowser/btparser.cpp
+++ b/addons/kate/backtracebrowser/btparser.cpp
@@ -1,5 +1,5 @@
/* This file is part of the KDE project
- Copyright 2008 Dominik Haumann <dhaumann kde org>
+ Copyright 2008-2014 Dominik Haumann <dhaumann kde org>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
@@ -22,151 +22,151 @@
#include <QDebug>
-static QString eolDelimiter(const QString& str)
+static QString eolDelimiter(const QString &str)
{
- // find the split character
- QString separator(QLatin1Char('\n'));
- if (str.indexOf(QLatin1String("\r\n")) != -1) {
- separator = QLatin1String("\r\n");
- } else if (str.indexOf(QLatin1Char('\r')) != -1 ) {
- separator = QLatin1Char('\r');
- }
- return separator;
+ // find the split character
+ QString separator(QLatin1Char('\n'));
+ if (str.indexOf(QLatin1String("\r\n")) != -1) {
+ separator = QLatin1String("\r\n");
+ } else if (str.indexOf(QLatin1Char('\r')) != -1) {
+ separator = QLatin1Char('\r');
+ }
+ return separator;
}
-static bool lineNoLessThan(const QString& lhs, const QString& rhs)
+static bool lineNoLessThan(const QString &lhs, const QString &rhs)
{
- QRegExp rx(QLatin1String("^#(\\d+)"));
- int ilhs = rx.indexIn(lhs);
- int lhsLn = rx.cap(1).toInt();
- int irhs = rx.indexIn(rhs);
- int rhsLn = rx.cap(1).toInt();
- if (ilhs != -1 && irhs != -1) {
- return lhsLn < rhsLn;
- } else {
- return lhs < rhs;
- }
+ QRegExp rx(QLatin1String("^#(\\d+)"));
+ int ilhs = rx.indexIn(lhs);
+ int lhsLn = rx.cap(1).toInt();
+ int irhs = rx.indexIn(rhs);
+ int rhsLn = rx.cap(1).toInt();
+ if (ilhs != -1 && irhs != -1) {
+ return lhsLn < rhsLn;
+ } else {
+ return lhs < rhs;
+ }
}
-static QStringList normalizeBt(const QStringList& l)
+static QStringList normalizeBt(const QStringList &l)
{
- QStringList normalized;
-
- bool append = false;
-
- for (int i = 0; i < l.size(); ++i) {
- QString str = l[i].trimmed();
- if (str.length()) {
- if (str[0] == QLatin1Char('#')) {
- normalized << str;
- append = true;
- } else if (append) {
- normalized.last() += QLatin1Char(' ') + str;
- }
- } else {
- append = false;
+ QStringList normalized;
+
+ bool append = false;
+
+ for (int i = 0; i < l.size(); ++i) {
+ QString str = l[i].trimmed();
+ if (str.length()) {
+ if (str[0] == QLatin1Char('#')) {
+ normalized << str;
+ append = true;
+ } else if (append) {
+ normalized.last() += QLatin1Char(' ') + str;
+ }
+ } else {
+ append = false;
+ }
}
- }
- qSort(normalized.begin(), normalized.end(), lineNoLessThan);
+ qSort(normalized.begin(), normalized.end(), lineNoLessThan);
- // now every single line contains a whole backtrace info
- return normalized;
+ // now every single line contains a whole backtrace info
+ return normalized;
}
-static BtInfo parseBtLine(const QString& line)
+static BtInfo parseBtLine(const QString &line)
{
- int index;
-
- // the syntax types we support are
- // a) #24 0xb688ff8e in QApplication::notify (this=0xbf997e8c, receiver=0x82607e8, e=0xbf997074) at kernel/qapplication.cpp:3115
- // b) #39 0xb634211c in g_main_context_dispatch () from /usr/lib/libglib-2.0.so.0
- // c) #41 0x0805e690 in ?? ()
- // d) #5 0xffffe410 in __kernel_vsyscall ()
+ int index;
+
+ // the syntax types we support are
+ // a) #24 0xb688ff8e in QApplication::notify (this=0xbf997e8c, receiver=0x82607e8, e=0xbf997074) at kernel/qapplication.cpp:3115
+ // b) #39 0xb634211c in g_main_context_dispatch () from /usr/lib/libglib-2.0.so.0
+ // c) #41 0x0805e690 in ?? ()
+ // d) #5 0xffffe410 in __kernel_vsyscall ()
+
+
+ // try a) cap #number(1), address(2), function(3), filename(4), linenumber(5)
+ static QRegExp rxa(QLatin1String("^#(\\d+)\\s+(0x\\w+)\\s+in\\s+(.+)\\s+at\\s+(.+):(\\d+)$"));
+ index = rxa.indexIn(line);
+ if (index == 0) {
+ BtInfo info;
+ info.original = line;
+ info.filename = rxa.cap(4);
+ info.function = rxa.cap(3);
+ info.address = rxa.cap(2);
+ info.line = rxa.cap(5).toInt();
+ info.step = rxa.cap(1).toInt();
+ info.type = BtInfo::Source;
+ return info;
+ }
+ // try b) cap #number(1), address(2), function(3), lib(4)
+ static QRegExp rxb(QLatin1String("^#(\\d+)\\s+(0x\\w+)\\s+in\\s+(.+)\\s+from\\s+(.+)$"));
+ index = rxb.indexIn(line);
+ if (index == 0) {
+ BtInfo info;
+ info.original = line;
+ info.filename = rxb.cap(4);
+ info.function = rxb.cap(3);
+ info.address = rxb.cap(2);
+ info.line = -1;
+ info.step = rxb.cap(1).toInt();
+ info.type = BtInfo::Lib;
+ return info;
+ }
- // try a) cap #number(1), address(2), function(3), filename(4), linenumber(5)
- static QRegExp rxa(QLatin1String("^#(\\d+)\\s+(0x\\w+)\\s+in\\s+(.+)\\s+at\\s+(.+):(\\d+)$"));
- index = rxa.indexIn(line);
- if (index == 0) {
- BtInfo info;
- info.original = line;
- info.filename = rxa.cap(4);
- info.function = rxa.cap(3);
- info.address = rxa.cap(2);
- info.line = rxa.cap(5).toInt();
- info.step = rxa.cap(1).toInt();
- info.type = BtInfo::Source;
- return info;
- }
+ // try c) #41 0x0805e690 in ?? ()
+ static QRegExp rxc(QLatin1String("^#(\\d+)\\s+(0x\\w+)\\s+in\\s+\\?\\?\\s+\\(\\)$"));
+ index = rxc.indexIn(line);
+ if (index == 0) {
+ BtInfo info;
+ info.original = line;
+ info.filename = QString();
+ info.function = QString();
+ info.address = rxc.cap(2);
+ info.line = -1;
+ info.step = rxc.cap(1).toInt();
+ info.type = BtInfo::Unknown;
+ return info;
+ }
- // try b) cap #number(1), address(2), function(3), lib(4)
- static QRegExp rxb(QLatin1String("^#(\\d+)\\s+(0x\\w+)\\s+in\\s+(.+)\\s+from\\s+(.+)$"));
- index = rxb.indexIn(line);
- if (index == 0) {
- BtInfo info;
- info.original = line;
- info.filename = rxb.cap(4);
- info.function = rxb.cap(3);
- info.address = rxb.cap(2);
- info.line = -1;
- info.step = rxb.cap(1).toInt();
- info.type = BtInfo::Lib;
- return info;
- }
+ // try d) #5 0xffffe410 in __kernel_vsyscall ()
+ static QRegExp rxd(QLatin1String("^#(\\d+)\\s+(0x\\w+)\\s+in\\s+(.+)$"));
+ index = rxd.indexIn(line);
+ if (index == 0) {
+ BtInfo info;
+ info.original = line;
+ info.filename = QString();
+ info.function = rxd.cap(3);
+ info.address = rxd.cap(2);
+ info.line = -1;
+ info.step = rxd.cap(1).toInt();
+ info.type = BtInfo::Unknown;
+ return info;
+ }
- // try c) #41 0x0805e690 in ?? ()
- static QRegExp rxc(QLatin1String("^#(\\d+)\\s+(0x\\w+)\\s+in\\s+\\?\\?\\s+\\(\\)$"));
- index = rxc.indexIn(line);
- if (index == 0) {
- BtInfo info;
- info.original = line;
- info.filename = QString();
- info.function = QString();
- info.address = rxc.cap(2);
- info.line = -1;
- info.step = rxc.cap(1).toInt();
- info.type = BtInfo::Unknown;
- return info;
- }
+ qDebug() << "Unknown backtrace line:" << line;
- // try d) #5 0xffffe410 in __kernel_vsyscall ()
- static QRegExp rxd(QLatin1String("^#(\\d+)\\s+(0x\\w+)\\s+in\\s+(.+)$"));
- index = rxd.indexIn(line);
- if (index == 0) {
BtInfo info;
- info.original = line;
- info.filename = QString();
- info.function = rxd.cap(3);
- info.address = rxd.cap(2);
- info.line = -1;
- info.step = rxd.cap(1).toInt();
- info.type = BtInfo::Unknown;
+ info.type = BtInfo::Invalid;
return info;
- }
-
- qDebug() << "Unknown backtrace line:" << line;
-
- BtInfo info;
- info.type = BtInfo::Invalid;
- return info;
}
-QList<BtInfo> KateBtParser::parseBacktrace(const QString& bt)
+QList<BtInfo> KateBtParser::parseBacktrace(const QString &bt)
{
- QStringList l = bt.split(eolDelimiter(bt), QString::SkipEmptyParts);
+ QStringList l = bt.split(eolDelimiter(bt), QString::SkipEmptyParts);
- l = normalizeBt(l);
+ l = normalizeBt(l);
- QList<BtInfo> btList;
- for (int i = 0; i < l.size(); ++i) {
- BtInfo info = parseBtLine(l[i]);
- if (info.type != BtInfo::Invalid) {
- btList.append(parseBtLine(l[i]));
+ QList<BtInfo> btList;
+ for (int i = 0; i < l.size(); ++i) {
+ BtInfo info = parseBtLine(l[i]);
+ if (info.type != BtInfo::Invalid) {
+ btList.append(parseBtLine(l[i]));
+ }
}
- }
- return btList;
+ return btList;
}
-// kate: space-indent on; indent-width 2; replace-tabs on;
+// kate: space-indent on; indent-width 4; replace-tabs on;
diff --git a/addons/kate/backtracebrowser/btparser.h b/addons/kate/backtracebrowser/btparser.h
index 5b1e170..f726215 100644
--- a/addons/kate/backtracebrowser/btparser.h
+++ b/addons/kate/backtracebrowser/btparser.h
@@ -1,5 +1,5 @@
/* This file is part of the KDE project
- Copyright 2008 Dominik Haumann <dhaumann kde org>
+ Copyright 2008-2014 Dominik Haumann <dhaumann kde org>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
@@ -24,25 +24,24 @@
class BtInfo
{
- public:
+public:
enum Type {
- Source = 0,
- Lib,
- Unknown,
- Invalid
+ Source = 0,
+ Lib,
+ Unknown,
+ Invalid
};
-
+
/**
* Default constructor => invalid element
*/
- BtInfo ()
- : step (-1)
- , line (-1)
- , type (Invalid)
- {
+ BtInfo()
+ : step(-1)
+ , line(-1)
+ , type(Invalid) {
}
- public:
+public:
QString original;
QString filename;
QString function;
@@ -53,12 +52,13 @@ class BtInfo
Type type;
};
-namespace KateBtParser {
+namespace KateBtParser
+{
-QList<BtInfo> parseBacktrace(const QString& bt);
+QList<BtInfo> parseBacktrace(const QString &bt);
}
#endif //KATE_BACKTRACEPARSER_H
-// kate: space-indent on; indent-width 2; replace-tabs on;
+// kate: space-indent on; indent-width 4; replace-tabs on;
diff --git a/addons/kate/backtracebrowser/katebacktracebrowser.cpp b/addons/kate/backtracebrowser/katebacktracebrowser.cpp
index f6a3ed2..562bd89 100644
--- a/addons/kate/backtracebrowser/katebacktracebrowser.cpp
+++ b/addons/kate/backtracebrowser/katebacktracebrowser.cpp
@@ -1,5 +1,5 @@
/* This file is part of the KDE project
- Copyright 2008 Dominik Haumann <dhaumann kde org>
+ Copyright 2008-2014 Dominik Haumann <dhaumann kde org>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
@@ -43,131 +43,131 @@
#include <QUrl>
//END Includes
-K_PLUGIN_FACTORY_WITH_JSON (KateBtBrowserFactory, "katebacktracebrowserplugin.json", registerPlugin<KateBtBrowserPlugin>();)
+K_PLUGIN_FACTORY_WITH_JSON(KateBtBrowserFactory, "katebacktracebrowserplugin.json", registerPlugin<KateBtBrowserPlugin>();)
-KateBtBrowserPlugin* KateBtBrowserPlugin::s_self = 0L;
+KateBtBrowserPlugin *KateBtBrowserPlugin::s_self = 0L;
static QStringList fileExtensions =
QStringList() << QLatin1String("*.cpp") << QLatin1String("*.cxx") <<
QLatin1String("*.c") << QLatin1String("*.cc") << QLatin1String("*.h") <<
QLatin1String("*.hpp") << QLatin1String("*.hxx") << QLatin1String("*.moc");
-KateBtBrowserPlugin::KateBtBrowserPlugin(QObject* parent, const QList<QVariant>&)
- : KTextEditor::Plugin(parent)
- , KTextEditor::ConfigPageInterface()
- , indexer(&db)
+KateBtBrowserPlugin::KateBtBrowserPlugin(QObject *parent, const QList<QVariant> &)
+ : KTextEditor::Plugin(parent)
+ , KTextEditor::ConfigPageInterface()
+ , indexer(&db)
{
- s_self = this;
- db.loadFromFile(QStandardPaths::locate(QStandardPaths::GenericDataLocation,
- QLatin1String("kate/backtracedatabase")));
+ s_self = this;
+ db.loadFromFile(QStandardPaths::locate(QStandardPaths::GenericDataLocation,
+ QLatin1String("kate/backtracedatabase")));
}
KateBtBrowserPlugin::~KateBtBrowserPlugin()
{
- if (indexer.isRunning()) {
- indexer.cancel();
- indexer.wait();
- }
+ if (indexer.isRunning()) {
+ indexer.cancel();
+ indexer.wait();
+ }
- db.saveToFile(QStandardPaths::locate(QStandardPaths::GenericDataLocation,
- QLatin1String("kate/backtracedatabase")));
+ db.saveToFile(QStandardPaths::locate(QStandardPaths::GenericDataLocation,
+ QLatin1String("kate/backtracedatabase")));
- s_self = 0L;
+ s_self = 0L;
}
-KateBtBrowserPlugin& KateBtBrowserPlugin::self()
+KateBtBrowserPlugin &KateBtBrowserPlugin::self()
{
- return *s_self;
+ return *s_self;
}
-QObject *KateBtBrowserPlugin::createView (KTextEditor::MainWindow *mainWindow)
+QObject *KateBtBrowserPlugin::createView(KTextEditor::MainWindow *mainWindow)
{
- KateBtBrowserPluginView * view = new KateBtBrowserPluginView(this, mainWindow);
- return view;
+ KateBtBrowserPluginView *view = new KateBtBrowserPluginView(this, mainWindow);
+ return view;
}
-KateBtDatabase& KateBtBrowserPlugin::database()
+KateBtDatabase &KateBtBrowserPlugin::database()
{
- return db;
+ return db;
}
-BtFileIndexer& KateBtBrowserPlugin::fileIndexer()
+BtFileIndexer &KateBtBrowserPlugin::fileIndexer()
{
- return indexer;
+ return indexer;
}
void KateBtBrowserPlugin::startIndexer()
{
- if (indexer.isRunning()) {
- indexer.cancel();
- indexer.wait();
- }
- KConfigGroup cg(KSharedConfig::openConfig(), "backtracebrowser");
- indexer.setSearchPaths(cg.readEntry("search-folders", QStringList()));
- indexer.setFilter(cg.readEntry("file-extensions", fileExtensions));
- indexer.start();
- emit newStatus(i18n("Indexing files..."));
+ if (indexer.isRunning()) {
+ indexer.cancel();
+ indexer.wait();
+ }
+ KConfigGroup cg(KSharedConfig::openConfig(), "backtracebrowser");
+ indexer.setSearchPaths(cg.readEntry("search-folders", QStringList()));
+ indexer.setFilter(cg.readEntry("file-extensions", fileExtensions));
+ indexer.start();
+ emit newStatus(i18n("Indexing files..."));
}
-int KateBtBrowserPlugin::configPages () const
+int KateBtBrowserPlugin::configPages() const
{
- return 1;
+ return 1;
}
-KTextEditor::ConfigPage* KateBtBrowserPlugin::configPage(int number, QWidget *parent)
+KTextEditor::ConfigPage *KateBtBrowserPlugin::configPage(int number, QWidget *parent)
{
- if (number == 0) {
- return new KateBtConfigWidget(parent);
- }
+ if (number == 0) {
+ return new KateBtConfigWidget(parent);
+ }
- return 0L;
+ return 0L;
}
-QString KateBtBrowserPlugin::configPageName (int number) const
+QString KateBtBrowserPlugin::configPageName(int number) const
{
- if (number == 0) {
- return i18n("Backtrace Browser");
- }
- return QString();
+ if (number == 0) {
+ return i18n("Backtrace Browser");
+ }
+ return QString();
}
-QString KateBtBrowserPlugin::configPageFullName (int number) const
+QString KateBtBrowserPlugin::configPageFullName(int number) const
{
- if (number == 0) {
- return i18n("Backtrace Browser Settings");
- }
- return QString();
+ if (number == 0) {
+ return i18n("Backtrace Browser Settings");
+ }
+ return QString();
}
-QIcon KateBtBrowserPlugin::configPageIcon (int) const
+QIcon KateBtBrowserPlugin::configPageIcon(int) const
{
- return QIcon::fromTheme(QLatin1String("kbugbuster"));
+ return QIcon::fromTheme(QLatin1String("kbugbuster"));
}
-KateBtBrowserPluginView::KateBtBrowserPluginView(KateBtBrowserPlugin* plugin, KTextEditor::MainWindow *mainWindow)
- : QObject(mainWindow), m_plugin(plugin)
+KateBtBrowserPluginView::KateBtBrowserPluginView(KateBtBrowserPlugin *plugin, KTextEditor::MainWindow *mainWindow)
+ : QObject(mainWindow), m_plugin(plugin)
{
- // init console
- QWidget *toolview = mainWindow->createToolView (plugin,
- QLatin1String("kate_private_plugin_katebacktracebrowserplugin"),
- KTextEditor::MainWindow::Bottom,
- QIcon::fromTheme(QLatin1String("kbugbuster")),
- i18n("Backtrace Browser"));
- m_widget = new KateBtBrowserWidget(mainWindow, toolview);
+ // init console
+ QWidget *toolview = mainWindow->createToolView(plugin,
+ QLatin1String("kate_private_plugin_katebacktracebrowserplugin"),
+ KTextEditor::MainWindow::Bottom,
+ QIcon::fromTheme(QLatin1String("kbugbuster")),
+ i18n("Backtrace Browser"));
+ m_widget = new KateBtBrowserWidget(mainWindow, toolview);
- connect(plugin, SIGNAL(newStatus(QString)),
- this, SLOT(setStatus(QString)));
+ connect(plugin, SIGNAL(newStatus(QString)),
+ this, SLOT(setStatus(QString)));
}
-KateBtBrowserPluginView::~KateBtBrowserPluginView ()
+KateBtBrowserPluginView::~KateBtBrowserPluginView()
{
- // cleanup, kill toolview + widget
- QWidget *toolview = m_widget->parentWidget();
- delete m_widget;
- delete toolview;
+ // cleanup, kill toolview + widget
+ QWidget *toolview = m_widget->parentWidget();
+ delete m_widget;
+ delete toolview;
}
@@ -175,153 +175,153 @@ KateBtBrowserPluginView::~KateBtBrowserPluginView ()
-KateBtBrowserWidget::KateBtBrowserWidget(KTextEditor::MainWindow *mainwindow, QWidget* parent)
- : QWidget(parent)
- , mw(mainwindow)
+KateBtBrowserWidget::KateBtBrowserWidget(KTextEditor::MainWindow *mainwindow, QWidget *parent)
+ : QWidget(parent)
+ , mw(mainwindow)
{
- setupUi(this);
+ setupUi(this);
- timer.setSingleShot(true);
- connect(&timer, SIGNAL(timeout()), this, SLOT(clearStatus()));
+ timer.setSingleShot(true);
+ connect(&timer, SIGNAL(timeout()), this, SLOT(clearStatus()));
- connect(btnBacktrace, SIGNAL(clicked()), this, SLOT(loadFile()));
- connect(btnClipboard, SIGNAL(clicked()), this, SLOT(loadClipboard()));
- connect(btnConfigure, SIGNAL(clicked()), this, SLOT(configure()));
- connect(lstBacktrace, SIGNAL(itemActivated(QTreeWidgetItem*,int)), this, SLOT(itemActivated(QTreeWidgetItem*,int)));
+ connect(btnBacktrace, SIGNAL(clicked()), this, SLOT(loadFile()));
+ connect(btnClipboard, SIGNAL(clicked()), this, SLOT(loadClipboard()));
+ connect(btnConfigure, SIGNAL(clicked()), this, SLOT(configure()));
+ connect(lstBacktrace, SIGNAL(itemActivated(QTreeWidgetItem *, int)), this, SLOT(itemActivated(QTreeWidgetItem *, int)));
}
-KateBtBrowserWidget::~KateBtBrowserWidget ()
+KateBtBrowserWidget::~KateBtBrowserWidget()
{
}
void KateBtBrowserWidget::loadFile()
{
- QString url = QFileDialog::getOpenFileName(mw->window(), i18n("Load Backtrace"));
- QFile f(url);
- if (f.open(QIODevice::ReadOnly | QIODevice::Text)) {
- QString str = QString::fromUtf8(f.readAll());
- loadBacktrace(str);
- }
+ QString url = QFileDialog::getOpenFileName(mw->window(), i18n("Load Backtrace"));
+ QFile f(url);
+ if (f.open(QIODevice::ReadOnly | QIODevice::Text)) {
+ QString str = QString::fromUtf8(f.readAll());
+ loadBacktrace(str);
+ }
}
void KateBtBrowserWidget::loadClipboard()
{
- QString bt = QApplication::clipboard()->text();
- loadBacktrace(bt);
+ QString bt = QApplication::clipboard()->text();
+ loadBacktrace(bt);
}
-void KateBtBrowserWidget::loadBacktrace(const QString& bt)
+void KateBtBrowserWidget::loadBacktrace(const QString &bt)
{
- QList<BtInfo> infos = KateBtParser::parseBacktrace(bt);
-
- lstBacktrace->clear();
- foreach (const BtInfo& info, infos) {
- QTreeWidgetItem* it = new QTreeWidgetItem(lstBacktrace);
- it->setData(0, Qt::DisplayRole, QString::number(info.step));
- it->setData(0, Qt::ToolTipRole, QString::number(info.step));
- QFileInfo fi(info.filename);
- it->setData(1, Qt::DisplayRole, fi.fileName());
- it->setData(1, Qt::ToolTipRole, info.filename);
+ QList<BtInfo> infos = KateBtParser::parseBacktrace(bt);
- if (info.type == BtInfo::Source) {
- it->setData(2, Qt::DisplayRole, QString::number(info.line));
- it->setData(2, Qt::ToolTipRole, QString::number(info.line));
- it->setData(2, Qt::UserRole, QVariant(info.line));
- }
- it->setData(3, Qt::DisplayRole, info.function);
- it->setData(3, Qt::ToolTipRole, info.function);
+ lstBacktrace->clear();
+ foreach(const BtInfo & info, infos) {
+ QTreeWidgetItem *it = new QTreeWidgetItem(lstBacktrace);
+ it->setData(0, Qt::DisplayRole, QString::number(info.step));
+ it->setData(0, Qt::ToolTipRole, QString::number(info.step));
+ QFileInfo fi(info.filename);
+ it->setData(1, Qt::DisplayRole, fi.fileName());
+ it->setData(1, Qt::ToolTipRole, info.filename);
- lstBacktrace->addTopLevelItem(it);
- }
- lstBacktrace->resizeColumnToContents(0);
- lstBacktrace->resizeColumnToContents(1);
- lstBacktrace->resizeColumnToContents(2);
+ if (info.type == BtInfo::Source) {
+ it->setData(2, Qt::DisplayRole, QString::number(info.line));
+ it->setData(2, Qt::ToolTipRole, QString::number(info.line));
+ it->setData(2, Qt::UserRole, QVariant(info.line));
+ }
+ it->setData(3, Qt::DisplayRole, info.function);
+ it->setData(3, Qt::ToolTipRole, info.function);
- if (lstBacktrace->topLevelItemCount()) {
- setStatus(i18n("Loading backtrace succeeded"));
- } else {
- setStatus(i18n("Loading backtrace failed"));
- }
+ lstBacktrace->addTopLevelItem(it);
+ }
+ lstBacktrace->resizeColumnToContents(0);
+ lstBacktrace->resizeColumnToContents(1);
+ lstBacktrace->resizeColumnToContents(2);
+
+ if (lstBacktrace->topLevelItemCount()) {
+ setStatus(i18n("Loading backtrace succeeded"));
+ } else {
+ setStatus(i18n("Loading backtrace failed"));
+ }
}
void KateBtBrowserWidget::configure()
{
- KateBtConfigDialog dlg(mw->window());
- dlg.exec();
-}
-
-void KateBtBrowserWidget::itemActivated(QTreeWidgetItem* item, int column)
-{
- Q_UNUSED(column);
-
- QVariant variant = item->data(2, Qt::UserRole);
- if (variant.isValid()) {
- int line = variant.toInt();
- QString file = QDir::fromNativeSeparators(item->data(1, Qt::ToolTipRole).toString());
- file = QDir::cleanPath(file);
-
- QString path = file;
- // if not absolute path + exists, try to find with index
- if (!QFile::exists(path)) {
- // try to match the backtrace forms ".*/foo/bar.txt" and "foo/bar.txt"
- static QRegExp rx1(QLatin1String("/([^/]+)/([^/]+)$"));
- int idx = rx1.indexIn(file);
- if (idx != -1) {
- file = rx1.cap(1) + QLatin1Char('/') + rx1.cap(2);
- } else {
- static QRegExp rx2(QLatin1String("([^/]+)/([^/]+)$"));
- idx = rx2.indexIn(file);
- if (idx != -1) {
- // file is of correct form
- } else {
- qDebug() << "file patter did not match:" << file;
- setStatus(i18n("File not found: %1", file));
- return;
+ KateBtConfigDialog dlg(mw->window());
+ dlg.exec();
+}
+
+void KateBtBrowserWidget::itemActivated(QTreeWidgetItem *item, int column)
+{
+ Q_UNUSED(column);
+
+ QVariant variant = item->data(2, Qt::UserRole);
+ if (variant.isValid()) {
+ int line = variant.toInt();
+ QString file = QDir::fromNativeSeparators(item->data(1, Qt::ToolTipRole).toString());
+ file = QDir::cleanPath(file);
+
+ QString path = file;
+ // if not absolute path + exists, try to find with index
+ if (!QFile::exists(path)) {
+ // try to match the backtrace forms ".*/foo/bar.txt" and "foo/bar.txt"
+ static QRegExp rx1(QLatin1String("/([^/]+)/([^/]+)$"));
+ int idx = rx1.indexIn(file);
+ if (idx != -1) {
+ file = rx1.cap(1) + QLatin1Char('/') + rx1.cap(2);
+ } else {
+ static QRegExp rx2(QLatin1String("([^/]+)/([^/]+)$"));
+ idx = rx2.indexIn(file);
+ if (idx != -1) {
+ // file is of correct form
+ } else {
+ qDebug() << "file patter did not match:" << file;
+ setStatus(i18n("File not found: %1", file));
+ return;
+ }
+ }
+ path = KateBtBrowserPlugin::self().database().value(file);
}
- }
- path = KateBtBrowserPlugin::self().database().value(file);
- }
- if (!path.isEmpty() && QFile::exists(path)) {
- KTextEditor::View* kv = mw->openUrl(QUrl(path));
- kv->setCursorPosition(KTextEditor::Cursor(line - 1, 0));
- kv->setFocus();
- setStatus(i18n("Opened file: %1", file));
+ if (!path.isEmpty() && QFile::exists(path)) {
+ KTextEditor::View *kv = mw->openUrl(QUrl(path));
+ kv->setCursorPosition(KTextEditor::Cursor(line - 1, 0));
+ kv->setFocus();
+ setStatus(i18n("Opened file: %1", file));
+ }
+ } else {
+ setStatus(i18n("No debugging information available"));
}
- } else {
- setStatus(i18n("No debugging information available"));
- }
}
-void KateBtBrowserWidget::setStatus(const QString& status)
+void KateBtBrowserWidget::setStatus(const QString &status)
{
- lblStatus->setText(status);
- timer.start(10*1000);
+ lblStatus->setText(status);
+ timer.start(10 * 1000);
}
void KateBtBrowserWidget::clearStatus()
{
- lblStatus->setText(QString());
+ lblStatus->setText(QString());
}
-KateBtConfigWidget::KateBtConfigWidget(QWidget* parent)
- : KTextEditor::ConfigPage(parent)
+KateBtConfigWidget::KateBtConfigWidget(QWidget *parent)
+ : KTextEditor::ConfigPage(parent)
{
- setupUi(this);
- edtUrl->setMode(KFile::Directory);
- edtUrl->setUrl(QUrl(QDir().absolutePath()));
+ setupUi(this);
+ edtUrl->setMode(KFile::Directory);
+ edtUrl->setUrl(QUrl(QDir().absolutePath()));
- reset();
+ reset();
- connect(btnAdd, SIGNAL(clicked()), this, SLOT(add()));
- connect(btnRemove, SIGNAL(clicked()), this, SLOT(remove()));
- connect(edtExtensions, SIGNAL(textChanged(QString)), this, SLOT(textChanged()));
+ connect(btnAdd, SIGNAL(clicked()), this, SLOT(add()));
+ connect(btnRemove, SIGNAL(clicked()), this, SLOT(remove()));
+ connect(edtExtensions, SIGNAL(textChanged(QString)), this, SLOT(textChanged()));
- m_changed = false;
+ m_changed = false;
}
KateBtConfigWidget::~KateBtConfigWidget()
@@ -330,89 +330,89 @@ KateBtConfigWidget::~KateBtConfigWidget()
void KateBtConfigWidget::apply()
{
- if (m_changed) {
- QStringList sl;
- for (int i = 0; i < lstFolders->count(); ++i) {
- sl << lstFolders->item(i)->data(Qt::DisplayRole).toString();
- }
- KConfigGroup cg(KSharedConfig::openConfig(), "backtracebrowser");
- cg.writeEntry("search-folders", sl);
+ if (m_changed) {
+ QStringList sl;
+ for (int i = 0; i < lstFolders->count(); ++i) {
+ sl << lstFolders->item(i)->data(Qt::DisplayRole).toString();
+ }
+ KConfigGroup cg(KSharedConfig::openConfig(), "backtracebrowser");
+ cg.writeEntry("search-folders", sl);
- QString filter = edtExtensions->text();
- filter.replace(QLatin1Char(','), QLatin1Char(' ')).replace(QLatin1Char(';'), QLatin1Char(' '));
- cg.writeEntry("file-extensions", filter.split(QLatin1Char(' '), QString::SkipEmptyParts));
+ QString filter = edtExtensions->text();
+ filter.replace(QLatin1Char(','), QLatin1Char(' ')).replace(QLatin1Char(';'), QLatin1Char(' '));
+ cg.writeEntry("file-extensions", filter.split(QLatin1Char(' '), QString::SkipEmptyParts));
- KateBtBrowserPlugin::self().startIndexer();
- m_changed = false;
- }
+ KateBtBrowserPlugin::self().startIndexer();
+ m_changed = false;
+ }
}
void KateBtConfigWidget::reset()
{
- KConfigGroup cg(KSharedConfig::openConfig(), "backtracebrowser");
- lstFolders->clear();
- lstFolders->addItems(cg.readEntry("search-folders", QStringList()));
- edtExtensions->setText(cg.readEntry("file-extensions", fileExtensions).join(QLatin1String(" ")));
+ KConfigGroup cg(KSharedConfig::openConfig(), "backtracebrowser");
+ lstFolders->clear();
+ lstFolders->addItems(cg.readEntry("search-folders", QStringList()));
+ edtExtensions->setText(cg.readEntry("file-extensions", fileExtensions).join(QLatin1String(" ")));
}
void KateBtConfigWidget::defaults()
{
- lstFolders->clear();
- edtExtensions->setText(fileExtensions.join(QLatin1String(" ")));
+ lstFolders->clear();
+ edtExtensions->setText(fileExtensions.join(QLatin1String(" ")));
- m_changed = true;
+ m_changed = true;
}
void KateBtConfigWidget::add()
{
- QDir url(edtUrl->lineEdit()->text());
- if (url.exists())
- if (lstFolders->findItems(url.absolutePath(), Qt::MatchExactly).size() == 0) {
- lstFolders->addItem(url.absolutePath());
- emit changed();
- m_changed = true;
- }
+ QDir url(edtUrl->lineEdit()->text());
+ if (url.exists())
+ if (lstFolders->findItems(url.absolutePath(), Qt::MatchExactly).size() == 0) {
+ lstFolders->addItem(url.absolutePath());
+ emit changed();
+ m_changed = true;
+ }
}
void KateBtConfigWidget::remove()
{
- QListWidgetItem* item = lstFolders->currentItem();
- if (item) {
- delete item;
- emit changed();
- m_changed = true;
- }
+ QListWidgetItem *item = lstFolders->currentItem();
+ if (item) {
+ delete item;
+ emit changed();
+ m_changed = true;
+ }
}
void KateBtConfigWidget::textChanged()
{
- emit changed();
- m_changed = true;
+ emit changed();
+ m_changed = true;
}
-KateBtConfigDialog::KateBtConfigDialog(QWidget* parent)
- : QDialog(parent)
+KateBtConfigDialog::KateBtConfigDialog(QWidget *parent)
+ : QDialog(parent)
{
- setWindowTitle(i18n("Backtrace Browser Settings"));
+ setWindowTitle(i18n("Backtrace Browser Settings"));
- m_configWidget = new KateBtConfigWidget(this);
+ m_configWidget = new KateBtConfigWidget(this);
- QVBoxLayout * layout = new QVBoxLayout(this);
+ QVBoxLayout *layout = new QVBoxLayout(this);
- QDialogButtonBox * box = new QDialogButtonBox(this);
- box->setStandardButtons(QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
+ QDialogButtonBox *box = new QDialogButtonBox(this);
+ box->setStandardButtons(QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
- layout->addWidget(m_configWidget);
- layout->addWidget(box);
+ layout->addWidget(m_configWidget);
+ layout->addWidget(box);
- connect(this, SIGNAL(accepted()), m_configWidget, SLOT(apply()));
- connect(box, SIGNAL(accepted()), this, SLOT(accept()));
- connect(box, SIGNAL(rejected()), this, SLOT(reject()));
+ connect(this, SIGNAL(accepted()), m_configWidget, SLOT(apply()));
+ connect(box, SIGNAL(accepted()), this, SLOT(accept()));
+ connect(box, SIGNAL(rejected()), this, SLOT(reject()));
}
KateBtConfigDialog::~KateBtConfigDialog()
@@ -421,4 +421,4 @@ KateBtConfigDialog::~KateBtConfigDialog()
#include "katebacktracebrowser.moc"
-// kate: space-indent on; indent-width 2; replace-tabs on;
+// kate: space-indent on; indent-width 4; replace-tabs on;
diff --git a/addons/kate/backtracebrowser/katebacktracebrowser.h b/addons/kate/backtracebrowser/katebacktracebrowser.h
index cb712f9..f9a1bbb 100644
--- a/addons/kate/backtracebrowser/katebacktracebrowser.h
+++ b/addons/kate/backtracebrowser/katebacktracebrowser.h
@@ -1,5 +1,5 @@
/* This file is part of the KDE project
- Copyright 2008 Dominik Haumann <dhaumann kde org>
+ Copyright 2008-2014 Dominik Haumann <dhaumann kde org>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
@@ -42,54 +42,54 @@ class KateBtBrowserPlugin : public KTextEditor::Plugin, public KTextEditor::Conf
Q_OBJECT
Q_INTERFACES(KTextEditor::ConfigPageInterface)
- public:
- explicit KateBtBrowserPlugin( QObject* parent = 0, const QList<QVariant>& = QList<QVariant>() );
+public:
+ explicit KateBtBrowserPlugin(QObject *parent = 0, const QList<QVariant> & = QList<QVariant>());
virtual ~KateBtBrowserPlugin();
- static KateBtBrowserPlugin& self();
+ static KateBtBrowserPlugin &self();
- QObject *createView (KTextEditor::MainWindow *mainWindow);
+ QObject *createView(KTextEditor::MainWindow *mainWindow);
- KateBtDatabase& database();
- BtFileIndexer& fileIndexer();
+ KateBtDatabase &database();
+ BtFileIndexer &fileIndexer();
void startIndexer();
- Q_SIGNALS:
- void newStatus(const QString&);
+Q_SIGNALS:
+ void newStatus(const QString &);
- //
- // PluginConfigPageInterface
- //
- public:
+ //
+ // PluginConfigPageInterface
+ //
+public:
virtual int configPages() const;
- virtual KTextEditor::ConfigPage* configPage (int number, QWidget *parent = 0);
+ virtual KTextEditor::ConfigPage *configPage(int number, QWidget *parent = 0);
virtual QString configPageName(int number) const;
virtual QString configPageFullName(int number) const;
virtual QIcon configPageIcon(int number) const;
- //
- // private data
- //
- private:
+ //
+ // private data
+ //
+private:
KateBtDatabase db;
BtFileIndexer indexer;
- static KateBtBrowserPlugin* s_self;
+ static KateBtBrowserPlugin *s_self;
};
class KateBtBrowserPluginView : public QObject
{
Q_OBJECT
- public:
- KateBtBrowserPluginView (KateBtBrowserPlugin* plugin, KTextEditor::MainWindow *mainWindow);
+public:
+ KateBtBrowserPluginView(KateBtBrowserPlugin *plugin, KTextEditor::MainWindow *mainWindow);
/**
* Virtual destructor.
*/
- ~KateBtBrowserPluginView ();
+ ~KateBtBrowserPluginView();
- private:
+private:
KateBtBrowserPlugin *m_plugin;
KateBtBrowserWidget *m_widget;
};
@@ -98,60 +98,60 @@ class KateBtBrowserWidget : public QWidget, public Ui::BtBrowserWidget
{
Q_OBJECT
- public:
- KateBtBrowserWidget(KTextEditor::MainWindow *mainwindow, QWidget* parent);
+public:
+ KateBtBrowserWidget(KTextEditor::MainWindow *mainwindow, QWidget *parent);
~KateBtBrowserWidget();
- void loadBacktrace(const QString& bt);
+ void loadBacktrace(const QString &bt);
- public Q_SLOTS:
+public Q_SLOTS:
void loadFile();
void loadClipboard();
void configure();
void clearStatus();
- void setStatus(const QString& status);
+ void setStatus(const QString &status);
- private Q_SLOTS:
- void itemActivated(QTreeWidgetItem* item, int column);
+private Q_SLOTS:
+ void itemActivated(QTreeWidgetItem *item, int column);
- private:
- KTextEditor::MainWindow* mw;
+private:
+ KTextEditor::MainWindow *mw;
QTimer timer;
};
class KateBtConfigWidget : public KTextEditor::ConfigPage, private Ui::BtConfigWidget
{
Q_OBJECT
- public:
- explicit KateBtConfigWidget(QWidget* parent = 0);
+public:
+ explicit KateBtConfigWidget(QWidget *parent = 0);
virtual ~KateBtConfigWidget();
- public Q_SLOTS:
+public Q_SLOTS:
virtual void apply();
virtual void reset();
virtual void defaults();
- private Q_SLOTS:
+private Q_SLOTS:
void add();
void remove();
void textChanged();
- private:
+private:
bool m_changed;
};
class KateBtConfigDialog : public QDialog
{
Q_OBJECT
- public:
- KateBtConfigDialog(QWidget* parent = 0);
+public:
+ KateBtConfigDialog(QWidget *parent = 0);
~KateBtConfigDialog();
private:
- KateBtConfigWidget* m_configWidget;
+ KateBtConfigWidget *m_configWidget;
};
#endif //KATE_BACKTRACEBROWSER_H
-// kate: space-indent on; indent-width 2; replace-tabs on;
+// kate: space-indent on; indent-width 4; replace-tabs on;