diff --git a/krusader/Dialogs/krspwidgets.h b/krusader/Dialogs/krspwidgets.h --- a/krusader/Dialogs/krspwidgets.h +++ b/krusader/Dialogs/krspwidgets.h @@ -53,6 +53,7 @@ { public: newFTPSub(); + ~newFTPSub() override; protected: void reject() override; diff --git a/krusader/Dialogs/krspwidgets.cpp b/krusader/Dialogs/krspwidgets.cpp --- a/krusader/Dialogs/krspwidgets.cpp +++ b/krusader/Dialogs/krspwidgets.cpp @@ -38,7 +38,6 @@ #include // missing ? #include -#include #include #include #include @@ -144,16 +143,6 @@ void newFTPSub::accept() { url->addToHistory(url->currentText()); - // save the history and completion list when the history combo is - // destroyed - KConfigGroup group(krConfig, "Private"); - QStringList list = url->completionObject()->items(); - group.writeEntry("newFTP Completion list", list); - list = url->historyItems(); - group.writeEntry("newFTP History list", list); - QString protocol = prefix->currentText(); - group.writeEntry("newFTP Protocol", protocol); - newFTPGUI::accept(); } @@ -163,6 +152,18 @@ newFTPGUI::reject(); } +newFTPSub::~newFTPSub() +{ + // Save the history and the completion list of the url comboBox + KConfigGroup group(krConfig, "Private"); + QStringList list = url->completionObject()->items(); + group.writeEntry("newFTP Completion list", list); + list = url->historyItems(); + group.writeEntry("newFTP History list", list); + QString protocol = prefix->currentText(); + group.writeEntry("newFTP Protocol", protocol); +} + /////////////////////////// KrMaskChoiceSub /////////////////////////////// KrMaskChoiceSub::KrMaskChoiceSub(QWidget * parent) : KrMaskChoice(parent) { diff --git a/krusader/Dialogs/newftpgui.cpp b/krusader/Dialogs/newftpgui.cpp --- a/krusader/Dialogs/newftpgui.cpp +++ b/krusader/Dialogs/newftpgui.cpp @@ -153,7 +153,7 @@ connect(buttonBox, &QDialogButtonBox::rejected, this, &newFTPGUI::reject); connect(prefix, QOverload::of(&KComboBox::activated), this, &newFTPGUI::slotTextChanged); - connect(url, QOverload::of(&KHistoryComboBox::activated), url, &KHistoryComboBox::addToHistory); + connect(url, QOverload::of(&KrHistoryComboBox::activated), url, &KrHistoryComboBox::addToHistory); if(!lastUsedProtocol.isEmpty()) { // update the port field