Commit f00603e7 authored by Christoph Cullmann's avatar Christoph Cullmann

GIT_SILENT: application of coding style

parent ff0afaab
......@@ -21,7 +21,6 @@
#include "btbrowsertest.h"
#include "btparser.h"
#include <QtTestWidgets>
#include <QTemporaryFile>
#include <QFileInfo>
......@@ -45,7 +44,6 @@ void KateBtBrowserTest::testParser()
// 3) #41 0x0805e690 in ?? ()
// 4) #5 0xffffe410 in __kernel_vsyscall ()
QString bt = QStringLiteral("#24 0xb688ff8e in QApplication::notify (this=0xbf997e8c, receiver=0x82607e8, e=0xbf997074) at kernel/qapplication.cpp:3115");
QList<BtInfo> info = KateBtParser::parseBacktrace(bt);
......
......@@ -23,7 +23,6 @@
#include <QDir>
#include <QDebug>
void KateBtDatabase::loadFromFile(const QString &url)
{
QFile file(url);
......@@ -32,7 +31,7 @@ void KateBtDatabase::loadFromFile(const QString &url)
QDataStream ds(&file);
ds >> db;
}
// qDebug() << "Number of entries in the backtrace database" << url << ":" << db.size();
// qDebug() << "Number of entries in the backtrace database" << url << ":" << db.size();
}
void KateBtDatabase::saveToFile(const QString &url) const
......@@ -43,7 +42,7 @@ void KateBtDatabase::saveToFile(const QString &url) const
QDataStream ds(&file);
ds << db;
}
// qDebug() << "Saved backtrace database to" << url;
// qDebug() << "Saved backtrace database to" << url;
}
QString KateBtDatabase::value(const QString &key)
......@@ -75,7 +74,7 @@ QString KateBtDatabase::value(const QString &key)
void KateBtDatabase::add(const QString &folder, const QStringList &files)
{
QMutexLocker locker(&mutex);
foreach(const QString &file, files) {
foreach (const QString &file, files) {
QStringList &sl = db[file];
QString entry = QDir::fromNativeSeparators(folder + QLatin1Char('/') + file);
if (!sl.contains(entry)) {
......
......@@ -36,7 +36,7 @@ BtFileIndexer::~BtFileIndexer()
void BtFileIndexer::setSearchPaths(const QStringList &urls)
{
searchPaths.clear();
foreach(const QString &url, urls) {
foreach (const QString &url, urls) {
if (!searchPaths.contains(url)) {
searchPaths += url;
}
......
......@@ -21,7 +21,6 @@
#include <QStringList>
#include <QDebug>
static QString eolDelimiter(const QString &str)
{
// find the split character
......@@ -84,7 +83,6 @@ static BtInfo parseBtLine(const QString &line)
// 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(QStringLiteral("^#(\\d+)\\s+(0x\\w+)\\s+in\\s+(.+)\\s+at\\s+(.+):(\\d+)$"));
index = rxa.indexIn(line);
......@@ -152,7 +150,7 @@ static BtInfo parseBtLine(const QString &line)
return info;
}
QList<BtInfo> KateBtParser::parseBacktrace(const QString &bt)
QList<BtInfo> KateBtParser::parseBacktrace(const QString &bt)
{
QStringList l = bt.split(eolDelimiter(bt), QString::SkipEmptyParts);
......
......@@ -16,13 +16,13 @@
Boston, MA 02110-1301, USA.
*/
//BEGIN Includes
// BEGIN Includes
#include "katebacktracebrowser.h"
#include "btparser.h"
#include "btfileindexer.h"
#include <klocalizedstring.h> // i18n
#include <klocalizedstring.h> // i18n
#include <kpluginfactory.h>
#include <kpluginloader.h>
#include <kaboutdata.h>
......@@ -42,23 +42,20 @@
#include <QDialogButtonBox>
#include <QUrl>
#include <QTreeWidget>
//END Includes
// END Includes
K_PLUGIN_FACTORY_WITH_JSON(KateBtBrowserFactory, "katebacktracebrowserplugin.json", registerPlugin<KateBtBrowserPlugin>();)
KateBtBrowserPlugin *KateBtBrowserPlugin::s_self = nullptr;
static QStringList fileExtensions =
QStringList() << QStringLiteral("*.cpp") << QStringLiteral("*.cxx") <<
QStringLiteral("*.c") << QStringLiteral("*.cc") << QStringLiteral("*.h") <<
QStringLiteral("*.hpp") << QStringLiteral("*.hxx") << QStringLiteral("*.moc");
static QStringList fileExtensions = QStringList() << QStringLiteral("*.cpp") << QStringLiteral("*.cxx") << QStringLiteral("*.c") << QStringLiteral("*.cc") << QStringLiteral("*.h") << QStringLiteral("*.hpp") << QStringLiteral("*.hxx")
<< QStringLiteral("*.moc");
KateBtBrowserPlugin::KateBtBrowserPlugin(QObject *parent, const QList<QVariant> &)
: KTextEditor::Plugin(parent)
, indexer(&db)
{
s_self = this;
db.loadFromFile(QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation)
+ QStringLiteral("/katebtbrowser/backtracedatabase.db"));
db.loadFromFile(QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) + QStringLiteral("/katebtbrowser/backtracedatabase.db"));
}
KateBtBrowserPlugin::~KateBtBrowserPlugin()
......@@ -68,8 +65,7 @@ KateBtBrowserPlugin::~KateBtBrowserPlugin()
indexer.wait();
}
const QString path = QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation)
+ QStringLiteral("/katebtbrowser");
const QString path = QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) + QStringLiteral("/katebtbrowser");
QDir().mkpath(path);
db.saveToFile(path + QStringLiteral("/backtracedatabase.db"));
......@@ -124,19 +120,12 @@ KTextEditor::ConfigPage *KateBtBrowserPlugin::configPage(int number, QWidget *pa
return nullptr;
}
KateBtBrowserPluginView::KateBtBrowserPluginView(KateBtBrowserPlugin *plugin, KTextEditor::MainWindow *mainWindow)
: QObject(mainWindow), m_plugin(plugin)
: QObject(mainWindow)
, m_plugin(plugin)
{
// init console
QWidget *toolview = mainWindow->createToolView(plugin,
QStringLiteral("kate_private_plugin_katebacktracebrowserplugin"),
KTextEditor::MainWindow::Bottom,
QIcon::fromTheme(QStringLiteral("tools-report-bug")),
i18n("Backtrace Browser"));
QWidget *toolview = mainWindow->createToolView(plugin, QStringLiteral("kate_private_plugin_katebacktracebrowserplugin"), KTextEditor::MainWindow::Bottom, QIcon::fromTheme(QStringLiteral("tools-report-bug")), i18n("Backtrace Browser"));
m_widget = new KateBtBrowserWidget(mainWindow, toolview);
connect(plugin, &KateBtBrowserPlugin::newStatus, m_widget, &KateBtBrowserWidget::setStatus);
......@@ -150,11 +139,6 @@ KateBtBrowserPluginView::~KateBtBrowserPluginView()
delete toolview;
}
KateBtBrowserWidget::KateBtBrowserWidget(KTextEditor::MainWindow *mainwindow, QWidget *parent)
: QWidget(parent)
, mw(mainwindow)
......@@ -194,7 +178,7 @@ void KateBtBrowserWidget::loadBacktrace(const QString &bt)
QList<BtInfo> infos = KateBtParser::parseBacktrace(bt);
lstBacktrace->clear();
foreach(const BtInfo &info, infos) {
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));
......@@ -223,7 +207,6 @@ void KateBtBrowserWidget::loadBacktrace(const QString &bt)
}
}
void KateBtBrowserWidget::configure()
{
KateBtConfigDialog dlg(mw->window());
......@@ -284,9 +267,6 @@ void KateBtBrowserWidget::clearStatus()
lblStatus->setText(QString());
}
KateBtConfigWidget::KateBtConfigWidget(QWidget *parent)
: KTextEditor::ConfigPage(parent)
{
......@@ -384,16 +364,11 @@ void KateBtConfigWidget::textChanged()
m_changed = true;
}
KateBtConfigDialog::KateBtConfigDialog(QWidget *parent)
: QDialog(parent)
{
setWindowTitle(i18n("Backtrace Browser Settings"));
m_configWidget = new KateBtConfigWidget(this);
QVBoxLayout *layout = new QVBoxLayout(this);
......
......@@ -27,7 +27,7 @@
// Standard includes
#include <KConfig>
#include <KLocalizedString> /// \todo Where is \c i18n() defined?
#include <KLocalizedString> /// \todo Where is \c i18n() defined?
#include <KIconLoader>
#include <KSharedConfig>
#include <KConfigGroup>
......@@ -38,52 +38,47 @@
#include <cassert>
namespace kate { namespace {
namespace kate
{
namespace
{
class KateDocItem : public QTreeWidgetItem
{
public:
KateDocItem(KTextEditor::Document* doc, QTreeWidget* tw)
: QTreeWidgetItem(tw)
, document(doc)
public:
KateDocItem(KTextEditor::Document *doc, QTreeWidget *tw)
: QTreeWidgetItem(tw)
, document(doc)
{
setText(0, doc->documentName());
setText(1, doc->url().toString());
setCheckState(0, Qt::Checked);
}
KTextEditor::Document* document;
KTextEditor::Document *document;
};
} // anonymous namespace
CloseConfirmDialog::CloseConfirmDialog(
QList<KTextEditor::Document*>& docs
, KToggleAction* show_confirmation_action
, QWidget* const parent
)
: QDialog(parent)
, m_docs(docs)
} // anonymous namespace
CloseConfirmDialog::CloseConfirmDialog(QList<KTextEditor::Document *> &docs, KToggleAction *show_confirmation_action, QWidget *const parent)
: QDialog(parent)
, m_docs(docs)
{
assert("Documents container expected to be non empty" && !docs.isEmpty());
setupUi(this);
setWindowTitle(i18nc("@title:window", "Close files confirmation"));
setModal(true);
buttonBox->button(QDialogButtonBox::Ok)->setDefault(true);
icon->setPixmap(KIconLoader::global()->loadIcon(QStringLiteral("dialog-warning"),KIconLoader::Desktop,KIconLoader::SizeLarge));
text->setText(
i18nc("@label:listbox", "You are about to close the following documents:")
);
icon->setPixmap(KIconLoader::global()->loadIcon(QStringLiteral("dialog-warning"), KIconLoader::Desktop, KIconLoader::SizeLarge));
text->setText(i18nc("@label:listbox", "You are about to close the following documents:"));
QStringList headers;
headers << i18nc("@title:column", "Document") << i18nc("@title:column", "Location");
m_docs_tree->setHeaderLabels(headers);
m_docs_tree->setSelectionMode(QAbstractItemView::SingleSelection);
m_docs_tree->setRootIsDecorated(false);
for (auto& doc : qAsConst(m_docs))
{
for (auto &doc : qAsConst(m_docs)) {
new KateDocItem(doc, m_docs_tree);
}
m_docs_tree->header()->setStretchLastSection(false);
......@@ -101,13 +96,13 @@ CloseConfirmDialog::CloseConfirmDialog(
connect(this, &CloseConfirmDialog::accepted, this, &CloseConfirmDialog::updateDocsList);
KConfigGroup gcg(KSharedConfig::openConfig(), "kate-close-except-like-CloseConfirmationDialog");
KWindowConfig::restoreWindowSize(windowHandle(),gcg); // restore dialog geometry from config
KWindowConfig::restoreWindowSize(windowHandle(), gcg); // restore dialog geometry from config
}
CloseConfirmDialog::~CloseConfirmDialog()
{
KConfigGroup gcg(KSharedConfig::openConfig(), "kate-close-except-like-CloseConfirmationDialog");
KWindowConfig::saveWindowSize(windowHandle(),gcg); // write dialog geometry to config
KWindowConfig::saveWindowSize(windowHandle(), gcg); // write dialog geometry to config
gcg.sync();
}
......@@ -116,16 +111,11 @@ CloseConfirmDialog::~CloseConfirmDialog()
*/
void CloseConfirmDialog::updateDocsList()
{
for (
QTreeWidgetItemIterator it(m_docs_tree, QTreeWidgetItemIterator::NotChecked)
; *it
; ++it
)
{
KateDocItem* item = static_cast<KateDocItem*>(*it);
for (QTreeWidgetItemIterator it(m_docs_tree, QTreeWidgetItemIterator::NotChecked); *it; ++it) {
KateDocItem *item = static_cast<KateDocItem *>(*it);
m_docs.removeAll(item->document);
qDebug() << "do not close the file " << item->document->url().toString();
}
}
} // namespace kate
} // namespace kate
......@@ -51,7 +51,7 @@ void ExternalToolTest::testLoadSave()
tool.arguments = QStringLiteral("none");
tool.input = QStringLiteral("in");
tool.workingDir = QStringLiteral("/usr/bin");
tool.mimetypes = QStringList{ QStringLiteral("everything") };
tool.mimetypes = QStringList {QStringLiteral("everything")};
tool.hasexec = true;
tool.actionName = QStringLiteral("asdf");
tool.cmdname = QStringLiteral("git-cola");
......@@ -73,7 +73,7 @@ void ExternalToolTest::testRunListDirectory()
tool->executable = QStringLiteral("ls");
tool->arguments = QStringLiteral("/usr");
tool->workingDir = QStringLiteral("/tmp");
tool->mimetypes = QStringList{};
tool->mimetypes = QStringList {};
tool->hasexec = true;
tool->actionName = QStringLiteral("ls");
tool->cmdname = QStringLiteral("ls");
......
......@@ -22,52 +22,73 @@
#include <KConfigGroup>
#include <QStandardPaths>
namespace {
QString toString(KateExternalTool::SaveMode saveMode)
{
switch (saveMode) {
case KateExternalTool::SaveMode::None: return QStringLiteral("None");
case KateExternalTool::SaveMode::CurrentDocument: return QStringLiteral("CurrentDocument");
case KateExternalTool::SaveMode::AllDocuments: return QStringLiteral("AllDocuments");
}
Q_ASSERT(false); // yout forgot a case above
return QStringLiteral("None");
namespace
{
QString toString(KateExternalTool::SaveMode saveMode)
{
switch (saveMode) {
case KateExternalTool::SaveMode::None:
return QStringLiteral("None");
case KateExternalTool::SaveMode::CurrentDocument:
return QStringLiteral("CurrentDocument");
case KateExternalTool::SaveMode::AllDocuments:
return QStringLiteral("AllDocuments");
}
Q_ASSERT(false); // yout forgot a case above
return QStringLiteral("None");
}
KateExternalTool::SaveMode toSaveMode(const QString & mode)
{
if (mode == QStringLiteral("None")) return KateExternalTool::SaveMode::None;
if (mode == QStringLiteral("CurrentDocument")) return KateExternalTool::SaveMode::CurrentDocument;
if (mode == QStringLiteral("AllDocuments")) return KateExternalTool::SaveMode::AllDocuments;
KateExternalTool::SaveMode toSaveMode(const QString &mode)
{
if (mode == QStringLiteral("None"))
return KateExternalTool::SaveMode::None;
}
if (mode == QStringLiteral("CurrentDocument"))
return KateExternalTool::SaveMode::CurrentDocument;
if (mode == QStringLiteral("AllDocuments"))
return KateExternalTool::SaveMode::AllDocuments;
return KateExternalTool::SaveMode::None;
}
QString toString(KateExternalTool::OutputMode outputMode)
{
switch (outputMode) {
case KateExternalTool::OutputMode::Ignore: return QStringLiteral("Ignore");
case KateExternalTool::OutputMode::InsertAtCursor: return QStringLiteral("InsertAtCursor");
case KateExternalTool::OutputMode::ReplaceSelectedText: return QStringLiteral("ReplaceSelectedText");
case KateExternalTool::OutputMode::ReplaceCurrentDocument: return QStringLiteral("ReplaceCurrentDocument");
case KateExternalTool::OutputMode::AppendToCurrentDocument: return QStringLiteral("AppendToCurrentDocument");
case KateExternalTool::OutputMode::InsertInNewDocument: return QStringLiteral("InsertInNewDocument");
case KateExternalTool::OutputMode::DisplayInPane: return QStringLiteral("DisplayInPane");
}
Q_ASSERT(false); // yout forgot a case above
return QStringLiteral("Ignore");
QString toString(KateExternalTool::OutputMode outputMode)
{
switch (outputMode) {
case KateExternalTool::OutputMode::Ignore:
return QStringLiteral("Ignore");
case KateExternalTool::OutputMode::InsertAtCursor:
return QStringLiteral("InsertAtCursor");
case KateExternalTool::OutputMode::ReplaceSelectedText:
return QStringLiteral("ReplaceSelectedText");
case KateExternalTool::OutputMode::ReplaceCurrentDocument:
return QStringLiteral("ReplaceCurrentDocument");
case KateExternalTool::OutputMode::AppendToCurrentDocument:
return QStringLiteral("AppendToCurrentDocument");
case KateExternalTool::OutputMode::InsertInNewDocument:
return QStringLiteral("InsertInNewDocument");
case KateExternalTool::OutputMode::DisplayInPane:
return QStringLiteral("DisplayInPane");
}
Q_ASSERT(false); // yout forgot a case above
return QStringLiteral("Ignore");
}
KateExternalTool::OutputMode toOutputMode(const QString & mode)
{
if (mode == QStringLiteral("Ignore")) return KateExternalTool::OutputMode::Ignore;
if (mode == QStringLiteral("InsertAtCursor")) return KateExternalTool::OutputMode::InsertAtCursor;
if (mode == QStringLiteral("ReplaceSelectedText")) return KateExternalTool::OutputMode::ReplaceSelectedText;
if (mode == QStringLiteral("ReplaceCurrentDocument")) return KateExternalTool::OutputMode::ReplaceCurrentDocument;
if (mode == QStringLiteral("AppendToCurrentDocument")) return KateExternalTool::OutputMode::AppendToCurrentDocument;
if (mode == QStringLiteral("InsertInNewDocument")) return KateExternalTool::OutputMode::InsertInNewDocument;
if (mode == QStringLiteral("DisplayInPane")) return KateExternalTool::OutputMode::DisplayInPane;
KateExternalTool::OutputMode toOutputMode(const QString &mode)
{
if (mode == QStringLiteral("Ignore"))
return KateExternalTool::OutputMode::Ignore;
}
if (mode == QStringLiteral("InsertAtCursor"))
return KateExternalTool::OutputMode::InsertAtCursor;
if (mode == QStringLiteral("ReplaceSelectedText"))
return KateExternalTool::OutputMode::ReplaceSelectedText;
if (mode == QStringLiteral("ReplaceCurrentDocument"))
return KateExternalTool::OutputMode::ReplaceCurrentDocument;
if (mode == QStringLiteral("AppendToCurrentDocument"))
return KateExternalTool::OutputMode::AppendToCurrentDocument;
if (mode == QStringLiteral("InsertInNewDocument"))
return KateExternalTool::OutputMode::InsertInNewDocument;
if (mode == QStringLiteral("DisplayInPane"))
return KateExternalTool::OutputMode::DisplayInPane;
return KateExternalTool::OutputMode::Ignore;
}
}
bool KateExternalTool::checkExec() const
......@@ -118,19 +139,8 @@ void KateExternalTool::save(KConfigGroup &cg) const
bool operator==(const KateExternalTool &lhs, const KateExternalTool &rhs)
{
return lhs.category == rhs.category
&& lhs.name == rhs.name
&& lhs.icon == rhs.icon
&& lhs.executable == rhs.executable
&& lhs.arguments == rhs.arguments
&& lhs.input == rhs.input
&& lhs.workingDir == rhs.workingDir
&& lhs.mimetypes == rhs.mimetypes
&& lhs.actionName == rhs.actionName
&& lhs.cmdname == rhs.cmdname
&& lhs.saveMode == rhs.saveMode
&& lhs.reload == rhs.reload
&& lhs.outputMode == rhs.outputMode;
return lhs.category == rhs.category && lhs.name == rhs.name && lhs.icon == rhs.icon && lhs.executable == rhs.executable && lhs.arguments == rhs.arguments && lhs.input == rhs.input && lhs.workingDir == rhs.workingDir &&
lhs.mimetypes == rhs.mimetypes && lhs.actionName == rhs.actionName && lhs.cmdname == rhs.cmdname && lhs.saveMode == rhs.saveMode && lhs.reload == rhs.reload && lhs.outputMode == rhs.outputMode;
}
// kate: space-indent on; indent-width 4; replace-tabs on;
......@@ -27,44 +27,44 @@
#include <QStandardPaths>
#include <QMenu>
KateBookmarkHandler::KateBookmarkHandler( KateFileBrowser *parent, QMenu* kpopupmenu )
: QObject( parent ),
KBookmarkOwner(),
mParent( parent ),
m_menu( kpopupmenu )
KateBookmarkHandler::KateBookmarkHandler(KateFileBrowser *parent, QMenu *kpopupmenu)
: QObject(parent)
, KBookmarkOwner()
, mParent(parent)
, m_menu(kpopupmenu)
{
setObjectName( QStringLiteral ("KateBookmarkHandler") );
if (!m_menu)
m_menu = new QMenu( parent);
setObjectName(QStringLiteral("KateBookmarkHandler"));
if (!m_menu)
m_menu = new QMenu(parent);
QString file = QStandardPaths::locate(QStandardPaths::GenericDataLocation, QStringLiteral("kate/fsbookmarks.xml"));
if ( file.isEmpty() )
file = QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) + QStringLiteral("/kate/fsbookmarks.xml");
QString file = QStandardPaths::locate(QStandardPaths::GenericDataLocation, QStringLiteral("kate/fsbookmarks.xml"));
if (file.isEmpty())
file = QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) + QStringLiteral("/kate/fsbookmarks.xml");
KBookmarkManager *manager = KBookmarkManager::managerForFile( file, QStringLiteral("kate") );
manager->setUpdate( true );
KBookmarkManager *manager = KBookmarkManager::managerForFile(file, QStringLiteral("kate"));
manager->setUpdate(true);
m_bookmarkMenu = new KBookmarkMenu( manager, this, m_menu, parent->actionCollection() );
m_bookmarkMenu = new KBookmarkMenu(manager, this, m_menu, parent->actionCollection());
}
KateBookmarkHandler::~KateBookmarkHandler()
{
delete m_bookmarkMenu;
delete m_bookmarkMenu;
}
QUrl KateBookmarkHandler::currentUrl() const
{
return mParent->dirOperator()->url();
return mParent->dirOperator()->url();
}
QString KateBookmarkHandler::currentTitle() const
{
return currentUrl().url();
return currentUrl().url();
}
void KateBookmarkHandler::openBookmark( const KBookmark & bm, Qt::MouseButtons, Qt::KeyboardModifiers )
void KateBookmarkHandler::openBookmark(const KBookmark &bm, Qt::MouseButtons, Qt::KeyboardModifiers)
{
emit openUrl(bm.url().url());
emit openUrl(bm.url().url());
}
// kate: space-indent on; indent-width 2; replace-tabs on;
This diff is collapsed.
......@@ -38,166 +38,159 @@
#include <KLocalizedString>
#include <KSharedConfig>
//BEGIN ACtionLBItem
// BEGIN ACtionLBItem
/*
QListboxItem that can store and return a string,
used for the toolbar action selector.
*/
class ActionLBItem : public QListWidgetItem
{
public:
ActionLBItem( QListWidget *lb = nullptr,
const QIcon &pm = QIcon(),
const QString &text = QString(),
const QString &str = QString() ) :
QListWidgetItem(pm, text, lb, 0 ),
_str(str)
{}
public:
ActionLBItem(QListWidget *lb = nullptr, const QIcon &pm = QIcon(), const QString &text = QString(), const QString &str = QString())
: QListWidgetItem(pm, text, lb, 0)
, _str(str)
{
}
QString idstring()
{
return _str;
return _str;
}
private:
private:
QString _str;
};
//END ActionLBItem
// END ActionLBItem
//BEGIN KateFileBrowserConfigPage
KateFileBrowserConfigPage::KateFileBrowserConfigPage( QWidget *parent, KateFileBrowser *kfb )
: KTextEditor::ConfigPage( parent ),
fileBrowser( kfb )
// BEGIN KateFileBrowserConfigPage
KateFileBrowserConfigPage::KateFileBrowserConfigPage(QWidget *parent, KateFileBrowser *kfb)
: KTextEditor::ConfigPage(parent)
, fileBrowser(kfb)
{
QVBoxLayout *lo = new QVBoxLayout( this );
int spacing = QApplication::style()->pixelMetric(QStyle::PM_DefaultLayoutSpacing);
lo->setSpacing( spacing );
lo->setContentsMargins(0, 0, 0, 0);
// Toolbar - a lot for a little...
QGroupBox *gbToolbar = new QGroupBox(i18n("Toolbar"), this );
acSel = new KActionSelector( gbToolbar );
acSel->setAvailableLabel( i18n("A&vailable actions:") );
acSel->setSelectedLabel( i18n("S&elected actions:") );
QVBoxLayout *vbox = new QVBoxLayout;
vbox->addWidget(acSel);
gbToolbar->setLayout(vbox);
lo->addWidget( gbToolbar );
connect(acSel, &KActionSelector::added, this, &KateFileBrowserConfigPage::slotMyChanged);
connect(acSel, &KActionSelector::removed, this, &KateFileBrowserConfigPage::slotMyChanged);
connect(acSel, &KActionSelector::movedUp, this, &KateFileBrowserConfigPage::slotMyChanged);
connect(acSel, &KActionSelector::movedDown, this, &KateFileBrowserConfigPage::slotMyChanged);
// make it look nice
lo->addStretch( 1