[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [kdepim] kleopatra: Clean up. Remove unused code. Add Q_DECL_OVERRIDE
From:       Montel Laurent <montel () kde ! org>
Date:       2015-07-31 20:40:27
Message-ID: E1ZLH6R-0007dT-AG () scm ! kde ! org
[Download RAW message or body]

Git commit b22cb7dd8468dce7ac01d14da35b3e2737e2e085 by Montel Laurent.
Committed on 31/07/2015 at 20:40.
Pushed by mlaurent into branch 'master'.

Clean up. Remove unused code. Add Q_DECL_OVERRIDE

M  +2    -2    kleopatra/commands/changeroottrustcommand.h
M  +2    -2    kleopatra/commands/refreshopenpgpcertscommand.cpp
M  +3    -6    kleopatra/crypto/gui/decryptverifyoperationwidget.cpp
M  +5    -5    kleopatra/crypto/gui/newsignencryptfileswizard.cpp
M  +2    -2    kleopatra/mainwindow_desktop.cpp
D  +0    -431  kleopatra/mainwindow_mobile.cpp
D  +0    -82   kleopatra/mainwindow_mobile.h
M  +15   -15   kleopatra/models/keylistmodel.cpp
M  +4    -4    kleopatra/models/keylistmodel.h
M  +5    -5    kleopatra/models/keylistsortfilterproxymodel.h
M  +14   -14   kleopatra/newcertificatewizard/newcertificatewizard.cpp
M  +2    -4    kleopatra/uiserver/createchecksumscommand.h
M  +2    -4    kleopatra/uiserver/decryptverifycommandemailbase.h
M  +2    -2    kleopatra/uiserver/decryptverifycommandfilesbase.h
M  +2    -2    kleopatra/uiserver/echocommand.h
M  +2    -2    kleopatra/uiserver/encryptcommand.h
M  +2    -2    kleopatra/uiserver/importfilescommand.h
M  +2    -2    kleopatra/uiserver/prepencryptcommand.h
M  +2    -2    kleopatra/uiserver/prepsigncommand.h
M  +2    -2    kleopatra/uiserver/selectcertificatecommand.h
M  +2    -2    kleopatra/uiserver/signcommand.h
M  +2    -2    kleopatra/uiserver/signencryptfilescommand.h
M  +2    -2    kleopatra/uiserver/verifychecksumscommand.h
M  +0    -10   kleopatra/utils/headerview.h
M  +1    -1    kleopatra/utils/log.cpp

http://commits.kde.org/kdepim/b22cb7dd8468dce7ac01d14da35b3e2737e2e085

diff --git a/kleopatra/commands/changeroottrustcommand.h \
b/kleopatra/commands/changeroottrustcommand.h index c0cecbc..37ce091 100644
--- a/kleopatra/commands/changeroottrustcommand.h
+++ b/kleopatra/commands/changeroottrustcommand.h
@@ -64,8 +64,8 @@ public:
     }
 
 private:
-    /* reimp */ void doStart();
-    /* reimp */ void doCancel();
+    void doStart() Q_DECL_OVERRIDE;
+    void doCancel() Q_DECL_OVERRIDE;
 
 private:
     class Private;
diff --git a/kleopatra/commands/refreshopenpgpcertscommand.cpp \
b/kleopatra/commands/refreshopenpgpcertscommand.cpp index 82087dd..88ac97c 100644
--- a/kleopatra/commands/refreshopenpgpcertscommand.cpp
+++ b/kleopatra/commands/refreshopenpgpcertscommand.cpp
@@ -99,7 +99,7 @@ bool RefreshOpenPGPCertsCommand::preStartHook(QWidget *parent) \
const  "<para>Are you sure you want to continue?</para>"),
             i18nc("@title:window", "OpenPGP Certificate Refresh"),
             KStandardGuiItem::cont(), KStandardGuiItem::cancel(),
-            QLatin1String("warn-refresh-openpgp-expensive"))
+            QStringLiteral("warn-refresh-openpgp-expensive"))
            == KMessageBox::Continue;
 }
 
@@ -137,7 +137,7 @@ QString RefreshOpenPGPCertsCommand::errorExitMessage(const \
QStringList &args) co  return i18nc("@info",
                  "<para>An error occurred while trying to refresh OpenPGP \
                certificates.</para> "
                  "<para>The output from <command>%1</command> was: \
                <message>%2</message></para>",
-                 args[0], errorString().replace(QLatin1String("\n"), \
QStringLiteral("<br>"))); +                 args[0], \
errorString().replace(QStringLiteral("\n"), QStringLiteral("<br>")));  }
 
 QString RefreshOpenPGPCertsCommand::successMessage(const QStringList &) const
diff --git a/kleopatra/crypto/gui/decryptverifyoperationwidget.cpp \
b/kleopatra/crypto/gui/decryptverifyoperationwidget.cpp index 117f204..4e934fb 100644
--- a/kleopatra/crypto/gui/decryptverifyoperationwidget.cpp
+++ b/kleopatra/crypto/gui/decryptverifyoperationwidget.cpp
@@ -175,9 +175,6 @@ void DecryptVerifyOperationWidget::setArchiveDefinitions(const \
std::vector< shar  }
 }
 
-static const int Mutable = 1;
-static const int Const   = 0;
-
 void DecryptVerifyOperationWidget::setMode(Mode mode)
 {
     setMode(mode, shared_ptr<ArchiveDefinition>());
@@ -214,7 +211,7 @@ void DecryptVerifyOperationWidget::setMode(Mode mode, const \
shared_ptr<ArchiveDe  DecryptVerifyOperationWidget::Mode \
DecryptVerifyOperationWidget::mode() const  {
     if (d->ui.verifyDetachedCB.isChecked())
-        if (d->ui.inputStack.currentIndex() == Const) {
+        if (d->ui.inputStack.currentIndex() == 0) {
             return VerifyDetachedWithSignature;
         } else {
             return VerifyDetachedWithSignedData;
@@ -232,7 +229,7 @@ void DecryptVerifyOperationWidget::setInputFileName(const QString \
&name)  
 QString DecryptVerifyOperationWidget::inputFileName() const
 {
-    if (d->ui.inputStack.currentIndex() == Const) {
+    if (d->ui.inputStack.currentIndex() == 0) {
         return d->ui.inputFileNameLB.text();
     } else {
         return d->ui.inputFileNameRQ.fileName();
@@ -247,7 +244,7 @@ void DecryptVerifyOperationWidget::setSignedDataFileName(const \
QString &name)  
 QString DecryptVerifyOperationWidget::signedDataFileName() const
 {
-    if (d->ui.signedDataStack.currentIndex() == Const) {
+    if (d->ui.signedDataStack.currentIndex() == 0) {
         return d->ui.signedDataFileNameLB.text();
     } else {
         return d->ui.signedDataFileNameRQ.fileName();
diff --git a/kleopatra/crypto/gui/newsignencryptfileswizard.cpp \
b/kleopatra/crypto/gui/newsignencryptfileswizard.cpp index 1511a6e..1ca7ef5 100644
--- a/kleopatra/crypto/gui/newsignencryptfileswizard.cpp
+++ b/kleopatra/crypto/gui/newsignencryptfileswizard.cpp
@@ -312,27 +312,27 @@ public:
 
     QString archiveName(Protocol p) const
     {
-        return field(p == OpenPGP ? QLatin1String("archive-name-pgp") : \
QLatin1String("archive-name-cms")).toString(); +        return field(p == OpenPGP ? \
QStringLiteral("archive-name-pgp") : QStringLiteral("archive-name-cms")).toString();  \
}  
     bool isRemoveUnencryptedFilesEnabled() const
     {
-        return field(QLatin1String("remove")).toBool();
+        return field(QStringLiteral("remove")).toBool();
     }
 
     bool isSignOnlySelected() const
     {
-        return field(QLatin1String("sign")).toBool();
+        return field(QStringLiteral("sign")).toBool();
     }
 
     bool isEncryptOnlySelected() const
     {
-        return field(QLatin1String("encrypt")).toBool();
+        return field(QStringLiteral("encrypt")).toBool();
     }
 
     bool isSignEncryptSelected() const
     {
-        return field(QLatin1String("signencrypt")).toBool() ;
+        return field(QStringLiteral("signencrypt")).toBool() ;
     }
 
     bool isSigningSelected() const
diff --git a/kleopatra/mainwindow_desktop.cpp b/kleopatra/mainwindow_desktop.cpp
index 0a3418d..3098d7a 100644
--- a/kleopatra/mainwindow_desktop.cpp
+++ b/kleopatra/mainwindow_desktop.cpp
@@ -317,10 +317,10 @@ MainWindow::Private::Private(MainWindow *qq)
 
     setupActions();
 
-    connect(&controller, SIGNAL(message(QString,int)),  q->statusBar(), \
SLOT(showMessage(QString,int))); +    connect(&controller, \
                &KeyListController::message,  q->statusBar(), \
                &QStatusBar::showMessage);
     connect(&controller, SIGNAL(contextMenuRequested(QAbstractItemView*,QPoint)), q, \
SLOT(slotContextMenuRequested(QAbstractItemView*,QPoint)));  
-    q->createGUI(QLatin1String("kleopatra.rc"));
+    q->createGUI(QStringLiteral("kleopatra.rc"));
 
     q->setAcceptDrops(true);
 
diff --git a/kleopatra/mainwindow_mobile.cpp b/kleopatra/mainwindow_mobile.cpp
deleted file mode 100644
index ac01436..0000000
--- a/kleopatra/mainwindow_mobile.cpp
+++ /dev/null
@@ -1,431 +0,0 @@
-/* -*- mode: c++; c-basic-offset:4 -*-
-    mainwindow_mobile.cpp
-
-    This file is part of Kleopatra, the KDE keymanager
-    Copyright (c) 2010 Klarälvdalens Datakonsult AB
-
-    Kleopatra 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.
-
-    Kleopatra 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; if not, write to the Free Software
-    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
-
-    In addition, as a special exception, the copyright holders give
-    permission to link the code of this program with any edition of
-    the Qt library by Trolltech AS, Norway (or with modified versions
-    of Qt that use the same license as Qt), and distribute linked
-    combinations including the two.  You must obey the GNU General
-    Public License in all respects for all of the code used other than
-    Qt.  If you modify this file, you may extend this exception to
-    your version of the file, but you are not obligated to do so.  If
-    you do not wish to do so, delete this exception statement from
-    your version.
-*/
-
-#include <config-kleopatra.h>
-
-#include "mainwindow_mobile.h"
-
-#include "aboutdata.h"
-
-#include "models/keylistmodel.h"
-#include "models/keylistsortfilterproxymodel.h"
-
-#include "view/searchbar.h"
-#if 0
-#include "view/tabwidget.h"
-#endif
-#include "view/keytreeview.h"
-#include "view/keylistcontroller.h"
-
-#include "commands/selftestcommand.h"
-#include "commands/importcrlcommand.h"
-#include "commands/importcertificatefromfilecommand.h"
-#include "commands/decryptverifyfilescommand.h"
-#include "commands/signencryptfilescommand.h"
-
-#include "utils/detail_p.h"
-#include "utils/gnupg-helper.h"
-#include "utils/action_data.h"
-#include "utils/classify.h"
-#include "utils/filedialog.h"
-
-// from libkdepim
-#include "progresswidget/statusbarprogresswidget.h"
-#include "progresswidget/progressdialog.h"
-
-// from mobileui
-#include "declarativewidgetbase.h"
-
-#include <KActionCollection>
-#include <KLocalizedString>
-#include <KStandardAction>
-#include <K4AboutData>
-#include <KMessageBox>
-#include <KStandardGuiItem>
-#include <KLineEdit>
-#if 0
-#include <KShortcutsDialog>
-#endif
-#include <KAboutApplicationDialog>
-#include "kleopatra_debug.h"
-
-#include <QTreeView>
-#include <QApplication>
-#include <QCloseEvent>
-#include <QTimer>
-#include <QProcess>
-#include <QPointer>
-#include <QVariant>
-#include <QHeaderView>
-
-#include <kleo/stl_util.h>
-#include <kleo/cryptobackendfactory.h>
-#include <ui/cryptoconfigdialog.h>
-#include <kleo/cryptoconfig.h>
-
-#include <boost/bind.hpp>
-#include <boost/shared_ptr.hpp>
-
-#include <vector>
-
-#ifdef Q_OS_WIN32
-static const bool OS_WIN = true;
-#else
-static const bool OS_WIN = false;
-#endif
-
-using namespace Kleo;
-using namespace Kleo::Commands;
-using namespace boost;
-using namespace GpgME;
-
-namespace
-{
-
-static const K4AboutData *aboutGpg4WinData()
-{
-    static const AboutGpg4WinData data;
-    return &data;
-}
-
-}
-
-class MainWindow::KeyTreeViewItem : public DeclarativeWidgetBase<KeyTreeView, \
                MainWindow, &MainWindow::registerKeyTreeView>
-{
-    Q_OBJECT
-public:
-    explicit KeyTreeViewItem(QGraphicsItem *parent = Q_NULLPTR)
-        : DeclarativeWidgetBase<KeyTreeView, MainWindow, \
                &MainWindow::registerKeyTreeView>(parent) {}
-    ~KeyTreeViewItem() {}
-};
-
-class MainWindow::SearchBarItem : public DeclarativeWidgetBase<SearchBar, \
                MainWindow, &MainWindow::registerSearchBar>
-{
-    Q_OBJECT
-public:
-    explicit SearchBarItem(QGraphicsItem *parent = Q_NULLPTR)
-        : DeclarativeWidgetBase<SearchBar, MainWindow, \
                &MainWindow::registerSearchBar>(parent) {}
-    ~SearchBarItem() {}
-};
-
-static KGuiItem KStandardGuiItem_quit()
-{
-    static const QString app = \
                KComponentData::mainComponent().aboutData()->programName();
-    KGuiItem item = KStandardGuiItem::quit();
-    item.setText(i18nc("Quit [ApplicationName]", "&Quit %1", app));
-    return item;
-}
-
-static KGuiItem KStandardGuiItem_close()
-{
-    KGuiItem item = KStandardGuiItem::close();
-    item.setText(i18n("Only &Close Window"));
-    return item;
-}
-
-class MainWindow::Private
-{
-    friend class ::MainWindow;
-    MainWindow *const q;
-
-public:
-    explicit Private(MainWindow *qq);
-    ~Private();
-
-    void start(Command *c)
-    {
-        c->setParentWidget(q);
-        c->start();
-    }
-
-    template <typename T>
-    void createAndStart()
-    {
-        this->start(new T(this->currentView(), &this->controller));
-    }
-    template <typename T>
-    void createAndStart(QAbstractItemView *view)
-    {
-        start(new T(view, &this->controller));
-    }
-    template <typename T>
-    void createAndStart(const QStringList &a)
-    {
-        start(new T(a, this->currentView(), &this->controller));
-    }
-    template <typename T>
-    void createAndStart(const QStringList &a, QAbstractItemView *view)
-    {
-        start(new T(a, view, &this->controller));
-    }
-
-    void closeAndQuit()
-    {
-        qApp->quit();
-    }
-
-    void selfTest()
-    {
-        createAndStart<SelfTestCommand>();
-    }
-    void configureBackend();
-    void showHandbook();
-
-    void gnupgLogViewer()
-    {
-        if (!QProcess::startDetached(QStringLiteral("kwatchgnupg")))
-            KMessageBox::error(q, i18n("Could not start the GnuPG Log Viewer \
                (kwatchgnupg). "
-                                       "Please check your installation."),
-                               i18n("Error Starting KWatchGnuPG"));
-    }
-
-    void gnupgAdministrativeConsole()
-    {
-        if (!QProcess::startDetached(QStringLiteral("kgpgconf")))
-            KMessageBox::error(q, i18n("Could not start the GnuPG Administrative \
                Console (kgpgconf). "
-                                       "Please check your installation."),
-                               i18n("Error Starting KGpgConf"));
-    }
-
-    void slotConfigCommitted();
-    void slotSearchBarTextChanged(const QString &);
-
-    void aboutGpg4Win()
-    {
-        (new KAboutApplicationDialog(aboutGpg4WinData(), \
KAboutApplicationDialog::HideKdeVersion | KAboutApplicationDialog::HideTranslators, \
                q))->show();
-    }
-
-private:
-    void setupActions();
-    void tryToConnectSearchBarToKeyTreeView()
-    {
-        if (searchBar && keyTreeView) {
-            keyTreeView->connectSearchBar(searchBar);
-        }
-    }
-
-    QAbstractItemView *currentView() const
-    {
-        return controller.currentView();
-    }
-
-private:
-    QPointer<SearchBar> searchBar;
-    QPointer<KeyTreeView> keyTreeView;
-    Kleo::KeyListController controller;
-    bool firstShow : 1;
-};
-
-MainWindow::Private::Private(MainWindow *qq)
-    : q(qq),
-      searchBar(),
-      keyTreeView(),
-      controller(q),
-      firstShow(true)
-{
-    KDAB_SET_OBJECT_NAME(controller);
-
-    AbstractKeyListModel *flatModel = \
                AbstractKeyListModel::createFlatKeyListModel(q);
-    AbstractKeyListModel *hierarchicalModel = \
                AbstractKeyListModel::createHierarchicalKeyListModel(q);
-
-    KDAB_SET_OBJECT_NAME(flatModel);
-    KDAB_SET_OBJECT_NAME(hierarchicalModel);
-
-    controller.setFlatModel(flatModel);
-    controller.setHierarchicalModel(hierarchicalModel);
-    controller.setParentWidget(q);
-
-}
-
-MainWindow::Private::~Private() {}
-
-MainWindow::MainWindow(QWidget *parent)
-    : KDeclarativeFullScreenView(QLatin1String("kleopatra-mobile"), parent), d(new \
                Private(this))
-{
-}
-
-MainWindow::~MainWindow() {}
-
-void MainWindow::Private::setupActions()
-{
-
-    KActionCollection *const coll = q->actionCollection();
-
-    const action_data action_data[] = {
-        // Settings menu
-        {
-            "settings_self_test", i18n("Perform Self-Test"), QString(),
-            0, q, SLOT(selfTest()), QString(), false, true
-        },
-    };
-
-    make_actions_from_data(action_data, coll);
-
-    KStandardAction::close(q, SLOT(close()), coll);
-    KStandardAction::quit(q, SLOT(closeAndQuit()), coll);
-    KStandardAction::preferences(qApp, SLOT(openOrRaiseConfigDialog()), coll);
-
-    controller.createActions(coll);
-}
-
-void MainWindow::doDelayedInit()
-{
-    qmlRegisterType<KeyTreeViewItem>("org.kde.kleopatra", 2, 1, "KeyTreeView");
-    qmlRegisterType<SearchBarItem> ("org.kde.kleopatra", 2, 1, "SearchBar");
-    d->setupActions();
-    engine()->rootContext()->setContextProperty(QLatin1String("application"), \
                QVariant::fromValue(static_cast<QObject *>(this)));
-}
-
-void MainWindow::registerKeyTreeView(KeyTreeView *view)
-{
-    if (!view) {
-        return;
-    }
-    view->setFlatModel(d->controller.flatModel());
-    view->setHierarchicalModel(d->controller.hierarchicalModel());
-    QTreeView *const v = view->view();
-    v->setItemsExpandable(false);
-    v->header()->setResizeMode(QHeaderView::Stretch);
-    v->header()->hide();
-    d->controller.addView(v);
-    d->controller.setCurrentView(v);
-    d->keyTreeView = view;
-    d->tryToConnectSearchBarToKeyTreeView();
-
-    connect(v->model(), SIGNAL(rowsInserted(QModelIndex,int,int)),
-            SIGNAL(certificatesAvailabilityChanged()));
-    connect(v->model(), SIGNAL(rowsRemoved(QModelIndex,int,int)),
-            SIGNAL(certificatesAvailabilityChanged()));
-    connect(v->model(), SIGNAL(modelReset()),
-            SIGNAL(certificatesAvailabilityChanged()));
-
-    emit certificatesAvailabilityChanged();
-}
-
-void MainWindow::registerSearchBar(SearchBar *bar)
-{
-    if (!bar) {
-        return;
-    }
-    d->searchBar = bar;
-    bar->setFixedHeight(0);
-    connect(bar,  SIGNAL(stringFilterChanged(QString)),
-            this, SLOT(slotSearchBarTextChanged(QString)));
-    d->tryToConnectSearchBarToKeyTreeView();
-}
-
-void MainWindow::Private::slotConfigCommitted()
-{
-    controller.updateConfig();
-}
-
-void MainWindow::closeEvent(QCloseEvent *e)
-{
-
-    d->closeAndQuit();
-
-    // KMainWindow::closeEvent() insists on quitting the application,
-    // so do not let it touch the event...
-    qCDebug(KLEOPATRA_LOG);
-    if (d->controller.hasRunningCommands()) {
-        if (d->controller.shutdownWarningRequired()) {
-            const int ret = KMessageBox::warningContinueCancel(this, i18n("There are \
                still some background operations ongoing. "
-                            "These will be terminated when closing the window. "
-                            "Proceed?"),
-                            i18n("Ongoing Background Tasks"));
-            if (ret != KMessageBox::Continue) {
-                e->ignore();
-                return;
-            }
-        }
-        d->controller.cancelCommands();
-        if (d->controller.hasRunningCommands()) {
-            // wait for them to be finished:
-            setEnabled(false);
-            QEventLoop ev;
-            QTimer::singleShot(100, &ev, SLOT(quit()));
-            connect(&d->controller, SIGNAL(commandsExecuting(bool)), &ev, \
                SLOT(quit()));
-            ev.exec();
-            kWarning(d->controller.hasRunningCommands())
-                    << "controller still has commands running, this may crash \
                now...";
-            setEnabled(true);
-        }
-    }
-    e->accept();
-}
-
-void MainWindow::keyPressEvent(QKeyEvent *e)
-{
-    static bool isSendingEvent = false;
-
-    if (!isSendingEvent && d->searchBar && !e->text().isEmpty()) {
-        const struct guard {
-            guard()
-            {
-                isSendingEvent = true;
-            } ~guard()
-            {
-                isSendingEvent = false;
-            }
-        } guard;
-        QCoreApplication::sendEvent(d->searchBar->lineEdit(), e);
-    } else {
-        KDeclarativeFullScreenView::keyPressEvent(e);
-    }
-}
-
-void MainWindow::importCertificatesFromFile(const QStringList &files)
-{
-    if (!files.empty()) {
-        d->createAndStart<ImportCertificateFromFileCommand>(files);
-    }
-}
-
-void MainWindow::Private::slotSearchBarTextChanged(const QString &text)
-{
-    if (text.isEmpty() && searchBar && searchBar->isVisible()) {
-        searchBar->setFixedHeight(0);
-        searchBar->hide();
-    } else if (!text.isEmpty() && searchBar && !searchBar->isVisible()) {
-        searchBar->setFixedHeight(searchBar->minimumSizeHint().height());
-        searchBar->show();
-        searchBar->setFocus();
-    }
-}
-
-bool MainWindow::certificatesAvailable() const
-{
-    return (d->keyTreeView && d->keyTreeView->view()->model()->rowCount());
-}
-
-#include "moc_mainwindow_mobile.cpp"
-#include "mainwindow_mobile.moc"
diff --git a/kleopatra/mainwindow_mobile.h b/kleopatra/mainwindow_mobile.h
deleted file mode 100644
index e7a06fa..0000000
--- a/kleopatra/mainwindow_mobile.h
+++ /dev/null
@@ -1,82 +0,0 @@
-/* -*- mode: c++; c-basic-offset:4 -*-
-    mainwindow_mobile.h
-
-    This file is part of Kleopatra, the KDE keymanager
-    Copyright (c) 2010 Klarälvdalens Datakonsult AB
-
-    Kleopatra 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.
-
-    Kleopatra 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; if not, write to the Free Software
-    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
-
-    In addition, as a special exception, the copyright holders give
-    permission to link the code of this program with any edition of
-    the Qt library by Trolltech AS, Norway (or with modified versions
-    of Qt that use the same license as Qt), and distribute linked
-    combinations including the two.  You must obey the GNU General
-    Public License in all respects for all of the code used other than
-    Qt.  If you modify this file, you may extend this exception to
-    your version of the file, but you are not obligated to do so.  If
-    you do not wish to do so, delete this exception statement from
-    your version.
-*/
-
-#ifndef __KLEOPATRA_MAINWINDOW_MOBILE_H__
-#define __KLEOPATRA_MAINWINDOW_MOBILE_H__
-
-#include <kdeclarativefullscreenview.h>
-
-#include <utils/pimpl_ptr.h>
-
-namespace Kleo
-{
-class KeyTreeView;
-class SearchBar;
-}
-
-class QStringList;
-
-class MainWindow : public KDeclarativeFullScreenView
-{
-    Q_OBJECT
-    Q_PROPERTY(bool certificatesAvailable READ certificatesAvailable NOTIFY \
                certificatesAvailabilityChanged)
-public:
-    explicit MainWindow(QWidget *parent = Q_NULLPTR);
-    ~MainWindow();
-
-    bool certificatesAvailable() const;
-
-public Q_SLOTS:
-    void importCertificatesFromFile(const QStringList &files);
-
-Q_SIGNALS:
-    void certificatesAvailabilityChanged();
-
-protected:
-    /* reimp */ void doDelayedInit();
-    /* reimp */ void closeEvent(QCloseEvent *);
-    /* reimp */ void keyPressEvent(QKeyEvent *);
-
-private:
-    void registerKeyTreeView(Kleo::KeyTreeView *view);
-    void registerSearchBar(Kleo::SearchBar *bar);
-
-private:
-    Q_PRIVATE_SLOT(d, void closeAndQuit())
-    Q_PRIVATE_SLOT(d, void selfTest())
-    Q_PRIVATE_SLOT(d, void slotSearchBarTextChanged(QString))
-    Q_PRIVATE_SLOT(d, void slotConfigCommitted())
-    class Private;
-    kdtools::pimpl_ptr<Private> d;
-};
-
-#endif /* __KLEOPATRA_MAINWINDOW_MOBILE_H__ */
diff --git a/kleopatra/models/keylistmodel.cpp b/kleopatra/models/keylistmodel.cpp
index b4cbfa6..b50a1aa 100644
--- a/kleopatra/models/keylistmodel.cpp
+++ b/kleopatra/models/keylistmodel.cpp
@@ -388,17 +388,17 @@ public:
     explicit FlatKeyListModel(QObject *parent = Q_NULLPTR);
     ~FlatKeyListModel();
 
-    /* reimp */ int rowCount(const QModelIndex &pidx) const
+    int rowCount(const QModelIndex &pidx) const Q_DECL_OVERRIDE
     {
         return pidx.isValid() ? 0 : mKeysByFingerprint.size() ;
     }
 
 private:
-    /* reimp */ Key doMapToKey(const QModelIndex &index) const;
-    /* reimp */ QModelIndex doMapFromKey(const Key &key, int col) const;
-    /* reimp */ QList<QModelIndex> doAddKeys(const std::vector<Key> &keys);
-    /* reimp */ void doRemoveKey(const Key &key);
-    /* reimp */ void doClear()
+    Key doMapToKey(const QModelIndex &index) const Q_DECL_OVERRIDE;
+    QModelIndex doMapFromKey(const Key &key, int col) const Q_DECL_OVERRIDE;
+    QList<QModelIndex> doAddKeys(const std::vector<Key> &keys) Q_DECL_OVERRIDE;
+    void doRemoveKey(const Key &key) Q_DECL_OVERRIDE;
+    void doClear() Q_DECL_OVERRIDE
     {
         mKeysByFingerprint.clear();
     }
@@ -414,22 +414,22 @@ public:
     explicit HierarchicalKeyListModel(QObject *parent = Q_NULLPTR);
     ~HierarchicalKeyListModel();
 
-    /* reimp */ int rowCount(const QModelIndex &pidx) const;
+    int rowCount(const QModelIndex &pidx) const Q_DECL_OVERRIDE;
     using AbstractKeyListModel::index;
-    /* reimp */ QModelIndex index(int row, int col, const QModelIndex &pidx) const;
-    /* reimp */ QModelIndex parent(const QModelIndex &idx) const;
+    QModelIndex index(int row, int col, const QModelIndex &pidx) const \
Q_DECL_OVERRIDE; +    QModelIndex parent(const QModelIndex &idx) const \
Q_DECL_OVERRIDE;  
-    bool hasChildren(const QModelIndex &pidx) const
+    bool hasChildren(const QModelIndex &pidx) const Q_DECL_OVERRIDE
     {
         return rowCount(pidx) > 0 ;
     }
 
 private:
-    /* reimp */ Key doMapToKey(const QModelIndex &index) const;
-    /* reimp */ QModelIndex doMapFromKey(const Key &key, int col) const;
-    /* reimp */ QList<QModelIndex> doAddKeys(const std::vector<Key> &keys);
-    /* reimp */ void doRemoveKey(const Key &key);
-    /* reimp */ void doClear()
+    Key doMapToKey(const QModelIndex &index) const Q_DECL_OVERRIDE;
+    QModelIndex doMapFromKey(const Key &key, int col) const Q_DECL_OVERRIDE;
+    QList<QModelIndex> doAddKeys(const std::vector<Key> &keys) Q_DECL_OVERRIDE;
+    void doRemoveKey(const Key &key) Q_DECL_OVERRIDE;
+    void doClear() Q_DECL_OVERRIDE
     {
         mTopLevels.clear();
         mKeysByFingerprint.clear();
diff --git a/kleopatra/models/keylistmodel.h b/kleopatra/models/keylistmodel.h
index 327aa2d..7ae9c1b 100644
--- a/kleopatra/models/keylistmodel.h
+++ b/kleopatra/models/keylistmodel.h
@@ -58,16 +58,16 @@ public:
     static AbstractKeyListModel *createFlatKeyListModel(QObject *parent = \
                Q_NULLPTR);
     static AbstractKeyListModel *createHierarchicalKeyListModel(QObject *parent = \
Q_NULLPTR);  
-    /* reimp */ GpgME::Key key(const QModelIndex &idx) const;
-    /* reimp */ std::vector<GpgME::Key> keys(const QList<QModelIndex> &indexes) \
const; +    GpgME::Key key(const QModelIndex &idx) const Q_DECL_OVERRIDE;
+    std::vector<GpgME::Key> keys(const QList<QModelIndex> &indexes) const \
Q_DECL_OVERRIDE;  
     using QAbstractItemModel::index;
-    /* reimp */ QModelIndex index(const GpgME::Key &key) const
+    QModelIndex index(const GpgME::Key &key) const Q_DECL_OVERRIDE
     {
         return index(key, 0);
     }
     QModelIndex index(const GpgME::Key &key, int col) const;
-    /* reimp */ QList<QModelIndex> indexes(const std::vector<GpgME::Key> &keys) \
const; +    QList<QModelIndex> indexes(const std::vector<GpgME::Key> &keys) const \
Q_DECL_OVERRIDE;  
 Q_SIGNALS:
     void rowAboutToBeMoved(const QModelIndex &old_parent, int old_row);
diff --git a/kleopatra/models/keylistsortfilterproxymodel.h \
b/kleopatra/models/keylistsortfilterproxymodel.h index aecaa44..380bbf9 100644
--- a/kleopatra/models/keylistsortfilterproxymodel.h
+++ b/kleopatra/models/keylistsortfilterproxymodel.h
@@ -60,12 +60,12 @@ public:
 
     virtual AbstractKeyListSortFilterProxyModel *clone() const = 0;
 
-    /* reimp */ GpgME::Key key(const QModelIndex &idx) const;
-    /* reimp */ std::vector<GpgME::Key> keys(const QList<QModelIndex> &indexes) \
const; +    GpgME::Key key(const QModelIndex &idx) const Q_DECL_OVERRIDE;
+    std::vector<GpgME::Key> keys(const QList<QModelIndex> &indexes) const \
Q_DECL_OVERRIDE;  
     using QAbstractItemModel::index;
-    /* reimp */ QModelIndex index(const GpgME::Key &key) const;
-    /* reimp */ QList<QModelIndex> indexes(const std::vector<GpgME::Key> &keys) \
const; +    QModelIndex index(const GpgME::Key &key) const Q_DECL_OVERRIDE;
+    QList<QModelIndex> indexes(const std::vector<GpgME::Key> &keys) const \
Q_DECL_OVERRIDE;  
 private:
     void init();
@@ -83,7 +83,7 @@ public:
     boost::shared_ptr<const KeyFilter> keyFilter() const;
     void setKeyFilter(const boost::shared_ptr<const KeyFilter> &kf);
 
-    /* reimp */ KeyListSortFilterProxyModel *clone() const;
+    KeyListSortFilterProxyModel *clone() const Q_DECL_OVERRIDE;
 
 protected:
     bool filterAcceptsRow(int source_row, const QModelIndex &source_parent) const \
                Q_DECL_OVERRIDE;
diff --git a/kleopatra/newcertificatewizard/newcertificatewizard.cpp \
b/kleopatra/newcertificatewizard/newcertificatewizard.cpp index 3734a84..80c0beb \
                100644
--- a/kleopatra/newcertificatewizard/newcertificatewizard.cpp
+++ b/kleopatra/newcertificatewizard/newcertificatewizard.cpp
@@ -702,7 +702,7 @@ private:
         connect(j, SIGNAL(result(GpgME::KeyGenerationResult,QByteArray,QString)),
                 this, \
SLOT(slotResult(GpgME::KeyGenerationResult,QByteArray,QString)));  if (const Error \
                err = j->start(createGnupgKeyParms()))
-            setField(QLatin1String("error"), i18n("Could not start certificate \
creation: %1", +            setField(QStringLiteral("error"), i18n("Could not start \
                certificate creation: %1",
                                                   \
QString::fromLocal8Bit(err.asString())));  else {
             job = j;
@@ -721,29 +721,29 @@ private Q_SLOTS:
                      ? i18n("Operation canceled.")
                      : i18n("Could not create certificate: %1",
                             QString::fromLocal8Bit(result.error().asString())));
-            setField(QLatin1String("url"), QString());
-            setField(QLatin1String("result"), QString());
+            setField(QStringLiteral("url"), QString());
+            setField(QStringLiteral("result"), QString());
         } else if (pgp()) {
-            setField(QLatin1String("error"), QString());
-            setField(QLatin1String("url"), QString());
-            setField(QLatin1String("result"), i18n("Certificate created \
successfully.\n" +            setField(QStringLiteral("error"), QString());
+            setField(QStringLiteral("url"), QString());
+            setField(QStringLiteral("result"), i18n("Certificate created \
                successfully.\n"
                                                    "Fingerprint: %1", \
QLatin1String(result.fingerprint())));  } else {
-            QFile file(tmpDir().absoluteFilePath(QLatin1String("request.p10")));
+            QFile file(tmpDir().absoluteFilePath(QStringLiteral("request.p10")));
 
             if (!file.open(QIODevice::WriteOnly)) {
-                setField(QLatin1String("error"), i18n("Could not write output file \
%1: %2", +                setField(QStringLiteral("error"), i18n("Could not write \
                output file %1: %2",
                                                       file.fileName(), \
                file.errorString()));
-                setField(QLatin1String("url"), QString());
-                setField(QLatin1String("result"), QString());
+                setField(QStringLiteral("url"), QString());
+                setField(QStringLiteral("result"), QString());
             } else {
                 file.write(request);
-                setField(QLatin1String("error"), QString());
-                setField(QLatin1String("url"), \
                QUrl::fromLocalFile(file.fileName()).toString());
-                setField(QLatin1String("result"), i18n("Certificate created \
successfully.")); +                setField(QStringLiteral("error"), QString());
+                setField(QStringLiteral("url"), \
QUrl::fromLocalFile(file.fileName()).toString()); +                \
setField(QStringLiteral("result"), i18n("Certificate created successfully."));  }
         }
-        setField(QLatin1String("fingerprint"), \
QString::fromLatin1(result.fingerprint())); +        \
setField(QStringLiteral("fingerprint"), QString::fromLatin1(result.fingerprint()));  \
job = 0;  Q_EMIT completeChanged();
         QMetaObject::invokeMethod(wizard(), "next", Qt::QueuedConnection);
diff --git a/kleopatra/uiserver/createchecksumscommand.h \
b/kleopatra/uiserver/createchecksumscommand.h index 235ca38..68c5242 100644
--- a/kleopatra/uiserver/createchecksumscommand.h
+++ b/kleopatra/uiserver/createchecksumscommand.h
@@ -54,8 +54,8 @@ public:
     }
 
 private:
-    int doStart();
-    void doCanceled();
+    int doStart() Q_DECL_OVERRIDE;
+    void doCanceled() Q_DECL_OVERRIDE;
 
 #ifdef Q_MOC_RUN
 private Q_SLOTS:
@@ -66,8 +66,6 @@ private Q_SLOTS:
 private:
     class Private;
     kdtools::pimpl_ptr<Private> d;
-    //Q_PRIVATE_SLOT( th, void done() )
-    //Q_PRIVATE_SLOT( this, void done(int,QString) )
 };
 
 }
diff --git a/kleopatra/uiserver/decryptverifycommandemailbase.h \
b/kleopatra/uiserver/decryptverifycommandemailbase.h index d9588ea..2863b7e 100644
--- a/kleopatra/uiserver/decryptverifycommandemailbase.h
+++ b/kleopatra/uiserver/decryptverifycommandemailbase.h
@@ -55,8 +55,8 @@ private:
     }
 
 private:
-    int doStart();
-    void doCanceled();
+    int doStart() Q_DECL_OVERRIDE;
+    void doCanceled() Q_DECL_OVERRIDE;
 public:
     static const char *staticName()
     {
@@ -71,8 +71,6 @@ private:
 class DecryptVerifyCommand : public AssuanCommandMixin<DecryptVerifyCommand, \
DecryptVerifyCommandEMailBase>  {
 public:
-    //DecryptVerifyFilesCommand();
-    //~DecryptVerifyFilesCommand();
 
 private:
     DecryptVerifyOperation operation() const
diff --git a/kleopatra/uiserver/decryptverifycommandfilesbase.h \
b/kleopatra/uiserver/decryptverifycommandfilesbase.h index e6c8b0a..e5ee3e4 100644
--- a/kleopatra/uiserver/decryptverifycommandfilesbase.h
+++ b/kleopatra/uiserver/decryptverifycommandfilesbase.h
@@ -65,8 +65,8 @@ private:
     virtual DecryptVerifyOperation operation() const = 0;
 
 private:
-    int doStart();
-    void doCanceled();
+    int doStart() Q_DECL_OVERRIDE;
+    void doCanceled() Q_DECL_OVERRIDE;
 public:
     // ### FIXME fix this
     static const char *staticName()
diff --git a/kleopatra/uiserver/echocommand.h b/kleopatra/uiserver/echocommand.h
index be9d3c1..26d4318 100644
--- a/kleopatra/uiserver/echocommand.h
+++ b/kleopatra/uiserver/echocommand.h
@@ -74,8 +74,8 @@ public:
     }
 
 private:
-    int doStart();
-    void doCanceled();
+    int doStart() Q_DECL_OVERRIDE;
+    void doCanceled() Q_DECL_OVERRIDE;
 
 private Q_SLOTS:
     void slotInquireData(int, const QByteArray &);
diff --git a/kleopatra/uiserver/encryptcommand.h \
b/kleopatra/uiserver/encryptcommand.h index 78682ae..b3a4445 100644
--- a/kleopatra/uiserver/encryptcommand.h
+++ b/kleopatra/uiserver/encryptcommand.h
@@ -46,8 +46,8 @@ public:
     EncryptCommand();
     virtual ~EncryptCommand();
 private:
-    int doStart();
-    void doCanceled();
+    int doStart() Q_DECL_OVERRIDE;
+    void doCanceled() Q_DECL_OVERRIDE;
 public:
     static const char *staticName()
     {
diff --git a/kleopatra/uiserver/importfilescommand.h \
b/kleopatra/uiserver/importfilescommand.h index b1c7a2f..f1261e6 100644
--- a/kleopatra/uiserver/importfilescommand.h
+++ b/kleopatra/uiserver/importfilescommand.h
@@ -52,8 +52,8 @@ public:
     }
 
 private:
-    int doStart();
-    void doCanceled();
+    int doStart() Q_DECL_OVERRIDE;
+    void doCanceled() Q_DECL_OVERRIDE;
 
 private:
     class Private;
diff --git a/kleopatra/uiserver/prepencryptcommand.h \
b/kleopatra/uiserver/prepencryptcommand.h index e9d4bfb..fb77f01 100644
--- a/kleopatra/uiserver/prepencryptcommand.h
+++ b/kleopatra/uiserver/prepencryptcommand.h
@@ -46,8 +46,8 @@ public:
     PrepEncryptCommand();
     virtual ~PrepEncryptCommand();
 private:
-    int doStart();
-    void doCanceled();
+    int doStart() Q_DECL_OVERRIDE;
+    void doCanceled() Q_DECL_OVERRIDE;
 public:
     static const char *staticName()
     {
diff --git a/kleopatra/uiserver/prepsigncommand.h \
b/kleopatra/uiserver/prepsigncommand.h index 0a60a90..f32f497 100644
--- a/kleopatra/uiserver/prepsigncommand.h
+++ b/kleopatra/uiserver/prepsigncommand.h
@@ -46,8 +46,8 @@ public:
     PrepSignCommand();
     virtual ~PrepSignCommand();
 private:
-    int doStart();
-    void doCanceled();
+    int doStart() Q_DECL_OVERRIDE;
+    void doCanceled() Q_DECL_OVERRIDE;
 public:
     static const char *staticName()
     {
diff --git a/kleopatra/uiserver/selectcertificatecommand.h \
b/kleopatra/uiserver/selectcertificatecommand.h index 0c06d71..78e3506 100644
--- a/kleopatra/uiserver/selectcertificatecommand.h
+++ b/kleopatra/uiserver/selectcertificatecommand.h
@@ -52,8 +52,8 @@ public:
     }
 
 private:
-    int doStart();
-    void doCanceled();
+    int doStart() Q_DECL_OVERRIDE;
+    void doCanceled() Q_DECL_OVERRIDE;
 
 private:
     class Private;
diff --git a/kleopatra/uiserver/signcommand.h b/kleopatra/uiserver/signcommand.h
index bf9a642..fa75dc6 100644
--- a/kleopatra/uiserver/signcommand.h
+++ b/kleopatra/uiserver/signcommand.h
@@ -47,8 +47,8 @@ public:
     ~SignCommand();
 
 private:
-    /* reimp */ int doStart();
-    /* reimp */ void doCanceled();
+    int doStart() Q_DECL_OVERRIDE;
+    void doCanceled() Q_DECL_OVERRIDE;
 public:
     static const char *staticName()
     {
diff --git a/kleopatra/uiserver/signencryptfilescommand.h \
b/kleopatra/uiserver/signencryptfilescommand.h index e99768a..9e83f7b 100644
--- a/kleopatra/uiserver/signencryptfilescommand.h
+++ b/kleopatra/uiserver/signencryptfilescommand.h
@@ -67,8 +67,8 @@ private:
         return SignAllowed | EncryptAllowed ;
     }
 private:
-    int doStart();
-    void doCanceled();
+    int doStart() Q_DECL_OVERRIDE;
+    void doCanceled() Q_DECL_OVERRIDE;
 public:
     static const char *staticName()
     {
diff --git a/kleopatra/uiserver/verifychecksumscommand.h \
b/kleopatra/uiserver/verifychecksumscommand.h index 93c1a4a..913ee6f 100644
--- a/kleopatra/uiserver/verifychecksumscommand.h
+++ b/kleopatra/uiserver/verifychecksumscommand.h
@@ -55,8 +55,8 @@ public:
     }
 
 private:
-    int doStart();
-    void doCanceled();
+    int doStart() Q_DECL_OVERRIDE;
+    void doCanceled() Q_DECL_OVERRIDE;
 
 #ifdef Q_MOC_RUN
 private Q_SLOTS:
diff --git a/kleopatra/utils/headerview.h b/kleopatra/utils/headerview.h
index 455f2a6..9061116 100644
--- a/kleopatra/utils/headerview.h
+++ b/kleopatra/utils/headerview.h
@@ -54,22 +54,12 @@ public:
 
     void setSectionResizeMode(unsigned int logicalIndex, ResizeMode mode);
     ResizeMode sectionResizeMode(unsigned int logicalIndex) const;
-#if 0
-    /* reimp */ void setModel(QAbstractItemModel *model);
-    /* reimp */ void setRootIndex(const QModelIndex &idx);
-#endif
 private:
     //@{
     /*! Defined, but not implemented, to catch at least some usage errors */
     void setResizeMode(int, ResizeMode);
     ResizeMode resizeMode() const;
     //@}
-#if 0
-protected:
-    /* reimp */ void updateGeometries();
-    void mousePressEvent(QMouseEvent *e) Q_DECL_OVERRIDE;
-    /* reimp */ void mouseReleaseEvent(QMouseEvent *e);
-#endif
 private:
     class Private;
     kdtools::pimpl_ptr<Private> d;
diff --git a/kleopatra/utils/log.cpp b/kleopatra/utils/log.cpp
index c02356f..e074467 100644
--- a/kleopatra/utils/log.cpp
+++ b/kleopatra/utils/log.cpp
@@ -157,7 +157,7 @@ shared_ptr<QIODevice> Log::createIOLogger(const \
shared_ptr<QIODevice> &io, const  
     shared_ptr<IODeviceLogger> logger(new IODeviceLogger(io));
 
-    const QString timestamp = \
QDateTime::currentDateTime().toString(QLatin1String("yyMMdd-hhmmss")); +    const \
QString timestamp = QDateTime::currentDateTime().toString(QStringLiteral("yyMMdd-hhmmss"));
  
     const QString fn = d->m_outputDirectory + QLatin1Char('/') + prefix + \
QLatin1Char('-') + timestamp + QLatin1Char('-') + KRandom::randomString(4);  \
shared_ptr<QFile> file(new QFile(fn));


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic