diff --git a/src/main.cpp b/src/main.cpp index 46df405..49c1fd1 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1,66 +1,66 @@ /* Copyright (C) 2013-2019 Montel Laurent This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "sieveeditor-version.h" #include "sieveeditormainwindow.h" -#include +#include #include #include #include #include #include #include int main(int argc, char **argv) { QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling); QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps, true); QApplication app(argc, argv); app.setDesktopFileName(QStringLiteral("org.kde.sieveeditor")); KCrash::initialize(); Kdelibs4ConfigMigrator migrate(QStringLiteral("sieveeditor")); migrate.setConfigFiles(QStringList() << QStringLiteral("sieveeditorrc") << QStringLiteral("sievetemplaterc")); migrate.setUiFiles(QStringList() << QStringLiteral("sieveeditorui.rc")); migrate.migrate(); KLocalizedString::setApplicationDomain("sieveeditor"); KAboutData aboutData(QStringLiteral("sieveeditor"), i18n("KSieve Editor"), QStringLiteral(SIEVEEDITOR_VERSION), i18n("Sieve Editor"), KAboutLicense::GPL_V2, i18n("Copyright © 2013-2019 sieveeditor authors")); aboutData.addAuthor(i18n("Laurent Montel"), i18n("Maintainer"), QStringLiteral("montel@kde.org")); QApplication::setWindowIcon(QIcon::fromTheme(QStringLiteral("kmail"))); KAboutData::setApplicationData(aboutData); QCommandLineParser parser; aboutData.setupCommandLine(&parser); parser.process(app); aboutData.processCommandLine(&parser); KDBusService service(KDBusService::Unique); SieveEditorMainWindow *mw = new SieveEditorMainWindow(); mw->show(); const int val = app.exec(); return val; } diff --git a/src/sieveeditorbookmarks.cpp b/src/sieveeditorbookmarks.cpp index 3683456..854d2bc 100644 --- a/src/sieveeditorbookmarks.cpp +++ b/src/sieveeditorbookmarks.cpp @@ -1,72 +1,72 @@ /* Copyright (C) 2015-2019 Montel Laurent This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "sieveeditorbookmarks.h" #include "sieveeditormainwindow.h" #include -#include +#include #include #include SieveEditorBookmarks::SieveEditorBookmarks(SieveEditorMainWindow *mainWindow, KActionCollection *collection, QMenu *menu, QObject *parent) : QObject(parent) , KBookmarkOwner() , mMenu(menu) , mMainWindow(mainWindow) { QString bookmarkFile = QStandardPaths::locate(QStandardPaths::GenericDataLocation, QStringLiteral("sieveeditor/bookmarks.xml")); if (bookmarkFile.isEmpty()) { bookmarkFile = QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) + QStringLiteral("/sieveeditor"); QDir().mkpath(bookmarkFile); bookmarkFile += QStringLiteral("/bookmarks.xml"); } KBookmarkManager *manager = KBookmarkManager::managerForFile(bookmarkFile, QStringLiteral("sieveeditor")); manager->setUpdate(true); mBookmarkMenu = new KBookmarkMenu(manager, this, mMenu, collection); } SieveEditorBookmarks::~SieveEditorBookmarks() { delete mBookmarkMenu; } QMenu *SieveEditorBookmarks::menu() const { return mMenu; } void SieveEditorBookmarks::openBookmark(const KBookmark &bm, Qt::MouseButtons mb, Qt::KeyboardModifiers km) { Q_UNUSED(mb); Q_UNUSED(km); Q_EMIT openUrl(bm.url()); } QString SieveEditorBookmarks::currentTitle() const { return mMainWindow->currentHelpTitle(); } QUrl SieveEditorBookmarks::currentUrl() const { return mMainWindow->currentHelpUrl(); } diff --git a/src/sieveeditorbookmarks.h b/src/sieveeditorbookmarks.h index 2a0c90b..6a100a6 100644 --- a/src/sieveeditorbookmarks.h +++ b/src/sieveeditorbookmarks.h @@ -1,53 +1,53 @@ /* Copyright (C) 2015-2019 Montel Laurent This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef SIEVEEDITORBOOKMARKS_H #define SIEVEEDITORBOOKMARKS_H #include -#include +#include class KBookmarkMenu; class QMenu; class KActionCollection; class SieveEditorMainWindow; class SieveEditorBookmarks : public QObject, public KBookmarkOwner { Q_OBJECT public: explicit SieveEditorBookmarks(SieveEditorMainWindow *mainWindow, KActionCollection *collection, QMenu *menu, QObject *parent = nullptr); ~SieveEditorBookmarks() override; QMenu *menu() const; void openBookmark(const KBookmark &bm, Qt::MouseButtons mb, Qt::KeyboardModifiers km) override; Q_REQUIRED_RESULT QString currentTitle() const override; Q_REQUIRED_RESULT QUrl currentUrl() const override; Q_SIGNALS: void openUrl(const QUrl &url); private: Q_DISABLE_COPY(SieveEditorBookmarks) KBookmarkMenu *mBookmarkMenu = nullptr; QMenu *mMenu = nullptr; SieveEditorMainWindow *mMainWindow = nullptr; }; #endif // SIEVEEDITORBOOKMARKS_H