diff --git a/core/basedialog.h b/core/basedialog.h index c6fcd212..84ca1152 100644 --- a/core/basedialog.h +++ b/core/basedialog.h @@ -1,46 +1,46 @@ /*************************************************************************** * Copyright (C) 2010 Matthias Fuchs * * * * 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; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . * ***************************************************************************/ #ifndef KGET_BASE_DIALOG #define KGET_BASE_DIALOG #include "kget_export.h" #include /** * Subclass to make sure that the size of the dialog is * automatically stored and restored */ class KGET_EXPORT KGetSaveSizeDialog : public QDialog { Q_OBJECT public: /** * Restores the dialog to the size saved for name */ - explicit KGetSaveSizeDialog(const QByteArray &name, QWidget *parent = nullptr, Qt::WFlags flags = 0); + explicit KGetSaveSizeDialog(const QByteArray &name, QWidget *parent = nullptr, Qt::WFlags flags = {}); virtual ~KGetSaveSizeDialog(); private: QByteArray m_name; }; #endif diff --git a/extensions/konqueror/kget_plug_in.cpp b/extensions/konqueror/kget_plug_in.cpp index f932443f..f719c4fa 100644 --- a/extensions/konqueror/kget_plug_in.cpp +++ b/extensions/konqueror/kget_plug_in.cpp @@ -1,243 +1,242 @@ /* This file is part of the KDE project Copyright (C) 2002 Patrick Charbonnier Copyright (C) 2002 Carsten Pfeiffer Copyright (C) 2007 Urs Wolfer Copyright (C) 2010 Dawit Alemayehu Copyright (C) 2010 Matthias Fuchs 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. */ #include "kget_plug_in.h" #include "kget_interface.h" #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #define QL1S(x) QLatin1String(x) K_PLUGIN_FACTORY(KGetPluginFactory, registerPlugin();) -K_EXPORT_PLUGIN(KGetPluginFactory("kgetplugin")) static QWidget* partWidget(QObject* obj) { KParts::ReadOnlyPart* part = qobject_cast(obj); return part ? part->widget() : nullptr; } KGetPlugin::KGetPlugin(QObject *parent, const QVariantList&) :KParts::Plugin(parent) { KActionMenu *menu = new KActionMenu(QIcon::fromTheme("kget"), i18n("Download Manager"), actionCollection()); actionCollection()->addAction("kget_menu", menu); menu->setDelayed( false ); connect( menu->menu(), SIGNAL(aboutToShow()), SLOT(showPopup())); m_dropTargetAction = new KToggleAction(i18n("Show Drop Target"), actionCollection()); connect(m_dropTargetAction, SIGNAL(triggered()), this, SLOT(slotShowDrop())); actionCollection()->addAction(QL1S("show_drop"), m_dropTargetAction); menu->addAction(m_dropTargetAction); QAction *showLinksAction = actionCollection()->addAction(QL1S("show_links")); showLinksAction->setText(i18n("List All Links")); connect(showLinksAction, SIGNAL(triggered()), SLOT(slotShowLinks())); menu->addAction(showLinksAction); QAction *showSelectedLinksAction = actionCollection()->addAction(QL1S("show_selected_links")); showSelectedLinksAction->setText(i18n("List Selected Links")); connect(showSelectedLinksAction, SIGNAL(triggered()), SLOT(slotShowSelectedLinks())); menu->addAction(showSelectedLinksAction); // Hide this plugin if the parent part does not support either // The FileInfo or Html extensions... if (!KParts::HtmlExtension::childObject(parent) && !KParts::FileInfoExtension::childObject(parent)) menu->setVisible(false); } KGetPlugin::~KGetPlugin() { } static bool hasDropTarget() { bool found = false; if (QDBusConnection::sessionBus().interface()->isServiceRegistered("org.kde.kget")) { OrgKdeKgetMainInterface kgetInterface("org.kde.kget", "/KGet", QDBusConnection::sessionBus()); QDBusReply reply = kgetInterface.dropTargetVisible(); if (reply.isValid()) { found = reply.value(); } } return found; } void KGetPlugin::showPopup() { // Check for HtmlExtension support... KParts::HtmlExtension* htmlExtn = KParts::HtmlExtension::childObject(parent()); if (htmlExtn) { KParts::SelectorInterface* selector = qobject_cast(htmlExtn); if (selector) { m_dropTargetAction->setChecked(hasDropTarget()); const KParts::SelectorInterface::QueryMethods methods = selector->supportedQueryMethods(); bool enable = (methods & KParts::SelectorInterface::EntireContent); actionCollection()->action(QL1S("show_links"))->setEnabled(enable); enable = (htmlExtn->hasSelection() && (methods & KParts::SelectorInterface::SelectedContent)); actionCollection()->action(QL1S("show_selected_links"))->setEnabled(enable); enable = (actionCollection()->action(QL1S("show_links"))->isEnabled() || actionCollection()->action(QL1S("show_selected_links"))->isEnabled()); actionCollection()->action(QL1S("show_drop"))->setEnabled(enable); return; } } // Check for FileInfoExtension support... KParts::FileInfoExtension* fileinfoExtn = KParts::FileInfoExtension::childObject(parent()); if (fileinfoExtn) { m_dropTargetAction->setChecked(hasDropTarget()); const KParts::FileInfoExtension::QueryModes modes = fileinfoExtn->supportedQueryModes(); bool enable = (modes & KParts::FileInfoExtension::AllItems); actionCollection()->action(QL1S("show_links"))->setEnabled(enable); enable = (fileinfoExtn->hasSelection() && (modes & KParts::FileInfoExtension::SelectedItems)); actionCollection()->action(QL1S("show_selected_links"))->setEnabled(enable); enable = (actionCollection()->action(QL1S("show_links"))->isEnabled() || actionCollection()->action(QL1S("show_selected_links"))->isEnabled()); actionCollection()->action(QL1S("show_drop"))->setEnabled(enable); return; } actionCollection()->action(QL1S("show_selected_links"))->setEnabled(false); actionCollection()->action(QL1S("show_links"))->setEnabled(false); actionCollection()->action(QL1S("show_drop"))->setEnabled(false); if (m_dropTargetAction->isChecked()) m_dropTargetAction->setChecked(false); } void KGetPlugin::slotShowDrop() { if (!QDBusConnection::sessionBus().interface()->isServiceRegistered("org.kde.kget")) { KRun::runCommand("kget --showDropTarget --hideMainWindow", "kget", "kget", partWidget(parent())); } else { OrgKdeKgetMainInterface kgetInterface("org.kde.kget", "/KGet", QDBusConnection::sessionBus()); kgetInterface.setDropTargetVisible(m_dropTargetAction->isChecked()); } } void KGetPlugin::slotShowLinks() { getLinks(false); } void KGetPlugin::slotShowSelectedLinks() { getLinks(true); } void KGetPlugin::slotImportLinks() { if (m_linkList.isEmpty()) { KMessageBox::sorry(partWidget(parent()), i18n("No downloadable links were found."), i18n("No Links")); return; } // Remove any duplicates links from the list... m_linkList.removeDuplicates(); if (!QDBusConnection::sessionBus().interface()->isServiceRegistered("org.kde.kget") && KToolInvocation::kdeinitExecWait("kget") != 0) { KMessageBox::sorry(partWidget(parent()), i18n("Unable to communicate with the KGet download manager."), i18n("Communication Error")); return; } OrgKdeKgetMainInterface kgetInterface("org.kde.kget", "/KGet", QDBusConnection::sessionBus()); kgetInterface.importLinks(m_linkList); } void KGetPlugin::getLinks(bool selectedOnly) { KParts::HtmlExtension* htmlExtn = KParts::HtmlExtension::childObject(parent()); if (htmlExtn) { KParts::SelectorInterface* selector = qobject_cast(htmlExtn); if (selector) { m_linkList.clear(); const QUrl baseUrl = htmlExtn->baseUrl(); const QString query = QL1S("a[href], img[src], audio[src], video[src], embed[src], object[data]"); const KParts::SelectorInterface::QueryMethod method = (selectedOnly ? KParts::SelectorInterface::SelectedContent: KParts::SelectorInterface::EntireContent); const QList elements = selector->querySelectorAll(query, method); QString attr; Q_FOREACH(const KParts::SelectorInterface::Element& element, elements) { if (element.hasAttribute(QL1S("href"))) attr = QL1S("href"); else if (element.hasAttribute(QL1S("src"))) attr = QL1S("src"); else if (element.hasAttribute(QL1S("data"))) attr = QL1S("data"); const QUrl resolvedUrl (baseUrl.resolved(QUrl(element.attribute(attr)))); // Only select valid and non-local links for download... if (resolvedUrl.isValid() && !resolvedUrl.isLocalFile() && !resolvedUrl.host().isEmpty()) { if (element.hasAttribute(QL1S("type"))) m_linkList << QString(QL1S("url ") + resolvedUrl.url() + QL1S(" type ") + element.attribute(QL1S("type"))); else m_linkList << resolvedUrl.url(); } } } slotImportLinks(); } KParts::FileInfoExtension* fileinfoExtn = KParts::FileInfoExtension::childObject(parent()); if (fileinfoExtn) { m_linkList.clear(); const KParts::FileInfoExtension::QueryMode mode = (selectedOnly ? KParts::FileInfoExtension::SelectedItems: KParts::FileInfoExtension::AllItems); const KFileItemList items = fileinfoExtn->queryFor(mode); Q_FOREACH(const KFileItem& item, items) { const QUrl url = item.url(); // Only select valid and non local links for download... if (item.isReadable() && item.isFile() && !item.isLocalFile() && !url.host().isEmpty()) { if (item.mimetype().isEmpty()) m_linkList << url.url(); else m_linkList << QString(QL1S("url ") + url.url() + QL1S(" type ") + item.mimetype()); } } slotImportLinks(); } } #include "kget_plug_in.moc" diff --git a/transfer-plugins/checksumsearch/dlgchecksumsearch.h b/transfer-plugins/checksumsearch/dlgchecksumsearch.h index d218fce3..952bbc01 100644 --- a/transfer-plugins/checksumsearch/dlgchecksumsearch.h +++ b/transfer-plugins/checksumsearch/dlgchecksumsearch.h @@ -1,136 +1,136 @@ /*************************************************************************** * Copyright (C) 2009 Matthias Fuchs * * * * 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; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . * ***************************************************************************/ #ifndef DLGCHECKSUMSEARCH_H #define DLGCHECKSUMSEARCH_H #include "ui_checksumsearch.h" #include "ui_checksumsearchadddlg.h" #include "checksumsearchtransferdatasource.h" #include #include #include class QSortFilterProxyModel; class QStandardItemModel; class QStringListModel; class ChecksumSearchAddDlg : public QDialog { Q_OBJECT public: - ChecksumSearchAddDlg(QStringListModel *modesModel, QStringListModel *typesModel, QWidget *parent = nullptr, Qt::WFlags flags = 0); + ChecksumSearchAddDlg(QStringListModel *modesModel, QStringListModel *typesModel, QWidget *parent = nullptr, Qt::WFlags flags = {}); signals: /** * Emitted when the dialog gets accepted * @param change the string that should change the source url by mode * @param mode the change mode * @param type the checksum type, can be an empty string */ void addItem(const QString &change, int mode, const QString &type); private slots: /** * Enables or disables buttons depending on if the user entered text or not, also changes * the label etc. */ void slotUpdate(); void slotAccpeted(); private: Ui::ChecksumSearchAddDlg ui; QStringListModel *m_modesModel; QStringListModel *m_typesModel; static const QUrl URL; }; class ChecksumDelegate : public QStyledItemDelegate { Q_OBJECT public: ChecksumDelegate(QObject *parent = nullptr); ChecksumDelegate(QStringListModel *modesModel, QStringListModel *typesModel, QObject *parent = nullptr); QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const override; void setEditorData(QWidget *editor, const QModelIndex &index) const override; void setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const override; void updateEditorGeometry(QWidget *editor, const QStyleOptionViewItem &option, const QModelIndex &index) const override; private: QStringListModel *m_modesModel; QStringListModel *m_typesModel; }; class DlgChecksumSettingsWidget : public KCModule { Q_OBJECT public: explicit DlgChecksumSettingsWidget(QWidget *parent = nullptr, const QVariantList &args = QVariantList()); ~DlgChecksumSettingsWidget(); public slots: void save() override; void load() override; private slots: /** * Oppens the AddDlg */ void slotAdd(); /** * Remove the selected indexes */ void slotRemove(); /** * Enables or disables buttons depending on if the user entered text or not, also changes * the label etc. */ void slotUpdate(); /** * Adds a new item defining how to proceed a search for checksums to the model * @param change the string that should change the source url by mode * @param mode the change mode, defined in verifier.h, using int instead of enum as convenience * @param type the checksum type, like e.g. "md5", empty if you do not know that * e.g. if change is "CHECKSUMS" you cannot know which checksums are present */ void slotAddItem(const QString &change, int mode, const QString &type = QString()); private: Ui::ChecksumSearch ui; QStandardItemModel *m_model; QSortFilterProxyModel *m_proxy; QStringList m_modes; QStringListModel *m_modesModel; QStringListModel *m_typesModel; }; #endif // DLGCHECKSUMSEARCH_H diff --git a/transfer-plugins/mirrorsearch/dlgmirrorsearch.cpp b/transfer-plugins/mirrorsearch/dlgmirrorsearch.cpp index 9b415bdb..8e9a8a7c 100644 --- a/transfer-plugins/mirrorsearch/dlgmirrorsearch.cpp +++ b/transfer-plugins/mirrorsearch/dlgmirrorsearch.cpp @@ -1,155 +1,167 @@ /* This file is part of the KDE project Copyright (C) 2008 Manolo Valdes 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. */ #include "dlgmirrorsearch.h" #include "kget_macro.h" #include "kget_debug.h" #include "mirrorsearchsettings.h" #include #include +#include #include #include #include #include DlgEngineEditing::DlgEngineEditing(QWidget *parent) : QDialog(parent) { QWidget *mainWidget = new QWidget(this); ui.setupUi(mainWidget); QVBoxLayout *mainLayout = new QVBoxLayout; setLayout(mainLayout); mainLayout->addWidget(mainWidget); setWindowTitle(i18n("Insert Engine")); setModal(true); QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok|QDialogButtonBox::Cancel); okButton = buttonBox->button(QDialogButtonBox::Ok); okButton->setDefault(true); okButton->setShortcut(Qt::CTRL | Qt::Key_Return); connect(buttonBox, &QDialogButtonBox::accepted, this, &DlgEngineEditing::accept); connect(buttonBox, &QDialogButtonBox::rejected, this, &DlgEngineEditing::reject); mainLayout->addWidget(buttonBox); ui.engineNameLabel->setText(i18n("Engine name:")); ui.urlLabel->setText(i18n("URL:")); connect(ui.urlEdit,SIGNAL(textChanged(QString)), SLOT(slotChangeText())); connect(ui.engineNameEdit,SIGNAL(textChanged(QString)),SLOT(slotChangeText())); slotChangeText(); } DlgEngineEditing::~DlgEngineEditing() { } void DlgEngineEditing::slotChangeText() { okButton->setEnabled(!ui.urlEdit->text().isEmpty()); } QString DlgEngineEditing::engineName() const { return ui.engineNameEdit->text(); } QString DlgEngineEditing::engineUrl() const { return ui.urlEdit->text(); } KGET_EXPORT_PLUGIN_CONFIG(DlgSettingsWidget) DlgSettingsWidget::DlgSettingsWidget(QWidget *parent, const QVariantList &args) : KCModule(/*KGetFactory::componentData(),*/ parent, args) { ui.setupUi(this); ui.newEngineBt->setIcon(QIcon::fromTheme("list-add")); ui.removeEngineBt->setIcon(QIcon::fromTheme("list-remove")); connect(ui.newEngineBt, SIGNAL(clicked()), SLOT(slotNewEngine())); connect(ui.removeEngineBt, SIGNAL(clicked()), SLOT(slotRemoveEngine())); } DlgSettingsWidget::~DlgSettingsWidget() { } void DlgSettingsWidget::slotNewEngine() { DlgEngineEditing dialog; if(dialog.exec()) { addSearchEngineItem(dialog.engineName(), dialog.engineUrl()); - changed(); +#if KCONFIGWIDGETS_VERSION < QT_VERSION_CHECK(5, 64, 0) + emit changed(); +#else + emit markAsChanged(); +#endif } } void DlgSettingsWidget::slotRemoveEngine() { QList selectedItems = ui.enginesTreeWidget->selectedItems(); foreach(QTreeWidgetItem * selectedItem, selectedItems) delete(selectedItem); - - changed(); +#if KCONFIGWIDGETS_VERSION < QT_VERSION_CHECK(5, 64, 0) + emit changed(); +#else + emit markAsChanged(); +#endif } void DlgSettingsWidget::load() { loadSearchEnginesSettings(); } void DlgSettingsWidget::addSearchEngineItem(const QString &name, const QString &url) { ui.enginesTreeWidget->addTopLevelItem(new QTreeWidgetItem(QStringList() << name << url)); - changed(); +#if KCONFIGWIDGETS_VERSION < QT_VERSION_CHECK(5, 64, 0) + emit changed(); +#else + emit markAsChanged(); +#endif } void DlgSettingsWidget::loadSearchEnginesSettings() { ui.enginesTreeWidget->clear();//Cleanup things first QStringList enginesNames = MirrorSearchSettings::self()->searchEnginesNameList(); QStringList enginesUrls = MirrorSearchSettings::self()->searchEnginesUrlList(); for(int i = 0; i < enginesNames.size(); i++) { addSearchEngineItem(enginesNames[i], enginesUrls[i]); } } void DlgSettingsWidget::saveSearchEnginesSettings() { QStringList enginesNames; QStringList enginesUrls; for(int i = 0; i < ui.enginesTreeWidget->topLevelItemCount(); i++) { enginesNames.append(ui.enginesTreeWidget->topLevelItem(i)->text(0)); enginesUrls.append(ui.enginesTreeWidget->topLevelItem(i)->text(1)); } MirrorSearchSettings::self()->setSearchEnginesNameList(enginesNames); MirrorSearchSettings::self()->setSearchEnginesUrlList(enginesUrls); MirrorSearchSettings::self()->save(); } void DlgSettingsWidget::save() { qCDebug(KGET_DEBUG); saveSearchEnginesSettings(); MirrorSearchSettings::self()->save(); } #include "dlgmirrorsearch.moc" diff --git a/transfer-plugins/mmsthreads/dlgmms.h b/transfer-plugins/mmsthreads/dlgmms.h index 9215fd3b..6019603a 100644 --- a/transfer-plugins/mmsthreads/dlgmms.h +++ b/transfer-plugins/mmsthreads/dlgmms.h @@ -1,40 +1,40 @@ /* This file is part of the KDE project Copyright (C) 2011 Ernesto Rodriguez Ortiz 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 3 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. If not, see . */ #ifndef DLGMMSTHREAD_H #define DLGMMSTHREAD_H #include #include "ui_dlgmms.h" class DlgMmsSettings : public KCModule { Q_OBJECT public: explicit DlgMmsSettings(QWidget * parent = nullptr, const QVariantList &args = QVariantList()); public slots: - virtual void save(); - virtual void load(); + void save() override; + void load() override; private: Ui::DlgMms ui; }; #endif // DLGMMSTHREAD_H diff --git a/ui/mirror/mirrorsettings.h b/ui/mirror/mirrorsettings.h index 88a852ce..2b261fce 100644 --- a/ui/mirror/mirrorsettings.h +++ b/ui/mirror/mirrorsettings.h @@ -1,87 +1,87 @@ /*************************************************************************** * Copyright (C) 2009 Matthias Fuchs * * * * 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; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . * ***************************************************************************/ #ifndef MIRRORSETTINGS_H #define MIRRORSETTINGS_H #include "mirrormodel.h" #include "../../core/basedialog.h" #include #include "ui_mirrorsettings.h" #include "ui_mirroradddlg.h" class QSortFilterProxyModel; class TransferHandler; class MirrorAddDlg : public QDialog { Q_OBJECT public: - explicit MirrorAddDlg(MirrorModel *model, QWidget *parent = nullptr, Qt::WFlags flags = 0); - explicit MirrorAddDlg(MirrorModel *model, QSortFilterProxyModel *countryModel, QWidget *parent = nullptr, Qt::WFlags flags = 0); + explicit MirrorAddDlg(MirrorModel *model, QWidget *parent = nullptr, Qt::WFlags flags = {}); + explicit MirrorAddDlg(MirrorModel *model, QSortFilterProxyModel *countryModel, QWidget *parent = nullptr, Qt::WFlags flags = {}); virtual QSize sizeHint() const override; /** * Shows or hides elements, by default all (expect MirrorItem::Used) are shown * @param type the type whose visibility should be modified * @param show if type should be shown or not * @note MirrorItem::Used and MirrorItem::Url can not be modified */ void showItem(MirrorItem::DataType type, bool show); private slots: void addMirror(); void updateButton(const QString &text = QString()); private: void init(); private: Ui::MirrorAddDlg ui; MirrorModel *m_model; QSortFilterProxyModel *m_countryModel; }; class MirrorSettings : public KGetSaveSizeDialog { Q_OBJECT public: MirrorSettings(QWidget *parent, TransferHandler *handler, const QUrl &file); virtual QSize sizeHint() const override; private slots: void updateButton(); void addClicked(); void removeMirror(); void save(); private: TransferHandler *m_transfer; QUrl m_file; MirrorModel *m_model; MirrorProxyModel *m_proxy; Ui::MirrorSettings ui; }; #endif diff --git a/ui/renamefile.h b/ui/renamefile.h index 26700018..d8c4e67f 100644 --- a/ui/renamefile.h +++ b/ui/renamefile.h @@ -1,51 +1,51 @@ /*************************************************************************** * Copyright (C) 2009 Matthias Fuchs * * * * 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; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . * ***************************************************************************/ #ifndef RENAMEFILE_H #define RENAMEFILE_H #include #include #include #include "ui_renamefile.h" class FileModel; class RenameFile : public QDialog { Q_OBJECT public: - RenameFile(FileModel *model, const QModelIndex &index, QWidget *parent = nullptr, Qt::WFlags flags = 0); + RenameFile(FileModel *model, const QModelIndex &index, QWidget *parent = nullptr, Qt::WFlags flags = {}); void setOriginalName(const QString &originalName); private slots: void updateButton(); void rename(); private: FileModel *m_model; QModelIndex m_index; Ui::RenameFile ui; QUrl m_dest; }; #endif diff --git a/ui/signaturedlg.h b/ui/signaturedlg.h index f6c36b7d..bab8dd2f 100644 --- a/ui/signaturedlg.h +++ b/ui/signaturedlg.h @@ -1,58 +1,58 @@ /*************************************************************************** * Copyright (C) 2009 Matthias Fuchs * * * * 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; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . * ***************************************************************************/ #ifndef SIGNATUREDLG_H #define SIGNATUREDLG_H #include #include "ui_signaturedlg.h" #include "../core/basedialog.h" class FileModel; class Signature; class TransferHandler; class SignatureDlg : public KGetSaveSizeDialog { Q_OBJECT public: - SignatureDlg(TransferHandler *transfer, const QUrl &dest, QWidget *parent = nullptr, Qt::WFlags flags = 0); + SignatureDlg(TransferHandler *transfer, const QUrl &dest, QWidget *parent = nullptr, Qt::WFlags flags = {}); private slots: void fileFinished(const QUrl &file); void verifyClicked(); void updateData(); void updateButtons(); void textChanged(); void loadSignatureClicked(); private: void clearData(); void handleWidgets(bool isAsciiSig); private: Ui::SignatureDlg ui; Signature *m_signature; FileModel *m_fileModel; QModelIndex m_file; static const QStringList OWNERTRUST; }; #endif diff --git a/ui/verificationdialog.h b/ui/verificationdialog.h index 271e7c63..238e75fc 100644 --- a/ui/verificationdialog.h +++ b/ui/verificationdialog.h @@ -1,82 +1,82 @@ /*************************************************************************** * Copyright (C) 2009 Matthias Fuchs * * * * 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; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . * ***************************************************************************/ #ifndef VERIFICATIONDIALOG_H #define VERIFICATIONDIALOG_H #include "ui_verificationdialog.h" #include "ui_verificationadddlg.h" #include "../core/basedialog.h" #include class FileModel; class QSortFilterProxyModel; class TransferHandler; class Verifier; class VerificationModel; class VerificationAddDlg : public QDialog { Q_OBJECT public: - explicit VerificationAddDlg(VerificationModel *model, QWidget *parent = nullptr, Qt::WFlags flags = 0); + explicit VerificationAddDlg(VerificationModel *model, QWidget *parent = nullptr, Qt::WFlags flags = {}); virtual QSize sizeHint() const override; private slots: void addChecksum(); void updateButton(); private: Ui::VerificationAddDlg ui; VerificationModel *m_model; QHash m_diggestLength; }; class VerificationDialog : public KGetSaveSizeDialog { Q_OBJECT public: VerificationDialog(QWidget *parent, TransferHandler *transfer, const QUrl &file); virtual QSize sizeHint() const override; private slots: void fileFinished(const QUrl &file); void updateButtons(); void addClicked(); void removeClicked(); void verifyClicked(); void slotVerified(bool verified); void slotFinished(); private: TransferHandler *m_transfer; Verifier *m_verifier; VerificationModel *m_model; QSortFilterProxyModel *m_proxy; FileModel *m_fileModel; QModelIndex m_file; Ui::VerificationDialog ui; }; #endif //VERIFICATIONDIALOG_H