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

List:       kde-commits
Subject:    [ktorrent/frameworks] /: exec->show
From:       Nick Shaforostoff <shafff () ukr ! net>
Date:       2015-12-01 1:30:04
Message-ID: E1a3Zlc-0000DW-H8 () scm ! kde ! org
[Download RAW message or body]

Git commit c95e8b8785c2310e739089acd9ed5e785b1bcbda by Nick Shaforostoff.
Committed on 01/12/2015 at 01:29.
Pushed by shaforo into branch 'frameworks'.

exec->show

M  +1    -1    ktorrent/core.cpp
M  +1    -1    ktorrent/core.h
M  +1    -0    ktorrent/dialogs/importdialog.cpp
M  +11   -20   ktorrent/dialogs/torrentcreatordlg.cpp
M  +8    -16   ktorrent/gui.cpp
M  +1    -0    ktorrent/ipfilterwidget.cpp
M  +1    -1    ktorrent/main.cpp
M  +2    -5    plugins/shutdown/CMakeLists.txt

http://commits.kde.org/ktorrent/c95e8b8785c2310e739089acd9ed5e785b1bcbda

diff --git a/ktorrent/core.cpp b/ktorrent/core.cpp
index a7d4586..7dc8c45 100644
--- a/ktorrent/core.cpp
+++ b/ktorrent/core.cpp
@@ -364,7 +364,7 @@ namespace kt
         return true;
     }
 
-    bt::TorrentInterface* Core::loadFromData(const QByteArray& data, const QString& \
dir, const QString& group, bool silently, const KUrl& url) +    bt::TorrentInterface* \
Core::loadFromData(const QByteArray& data, const QString& dir, const QString& group, \
bool silently, const QUrl& url)  {
         QString tdir = findNewTorrentDir();
         TorrentControl* tc = 0;
diff --git a/ktorrent/core.h b/ktorrent/core.h
index cbb068e..d12a6e3 100644
--- a/ktorrent/core.h
+++ b/ktorrent/core.h
@@ -229,7 +229,7 @@ namespace kt
         void startTCPServer(bt::Uint16 port);
         void startUTPServer(bt::Uint16 port);
         bt::TorrentInterface* loadFromFile(const QString& file, const QString& dir, \
                const QString& group, bool silently);
-        bt::TorrentInterface* loadFromData(const QByteArray& data, const QString& \
dir, const QString& group, bool silently, const KUrl& url); +        \
bt::TorrentInterface* loadFromData(const QByteArray& data, const QString& dir, const \
QString& group, bool silently, const QUrl& url);  
     public:
         void loadTorrents();
diff --git a/ktorrent/dialogs/importdialog.cpp b/ktorrent/dialogs/importdialog.cpp
index 71d8ea5..404ee91 100644
--- a/ktorrent/dialogs/importdialog.cpp
+++ b/ktorrent/dialogs/importdialog.cpp
@@ -51,6 +51,7 @@ namespace kt
     ImportDialog::ImportDialog(CoreInterface* core, QWidget* parent)
         : QDialog(parent), core(core), dc(0), dc_thread(0), canceled(false)
     {
+        setAttribute(Qt::WA_DeleteOnClose);
         setupUi(this);
         KUrlRequester* r = m_torrent_url;
         r->setMode(KFile::File | KFile::LocalOnly);
diff --git a/ktorrent/dialogs/torrentcreatordlg.cpp \
b/ktorrent/dialogs/torrentcreatordlg.cpp index 0c2a051..5e63e39 100644
--- a/ktorrent/dialogs/torrentcreatordlg.cpp
+++ b/ktorrent/dialogs/torrentcreatordlg.cpp
@@ -40,6 +40,7 @@ namespace kt
 {
     TorrentCreatorDlg::TorrentCreatorDlg(Core* core, GUI* gui, QWidget* parent) : \
KDialog(parent), core(core), gui(gui), mktor(0)  {
+        setAttribute(Qt::WA_DeleteOnClose);
         tracker_completion = webseeds_completion = nodes_completion = 0;
         setWindowTitle(i18n("Create A Torrent"));
         setupUi(mainWidget());
@@ -131,17 +132,17 @@ namespace kt
 
     void TorrentCreatorDlg::loadCompleterData()
     {
-        QString file = kt::DataDir() + "torrent_creator_known_trackers";
+        QString file = kt::DataDir() + \
QLatin1String("torrent_creator_known_trackers");  tracker_completion = new \
StringCompletionModel(file, this);  tracker_completion->load();
         m_tracker->setCompleter(new QCompleter(tracker_completion, this));
 
-        file = kt::DataDir() + "torrent_creator_known_webseeds";
+        file = kt::DataDir() + QLatin1String("torrent_creator_known_webseeds");
         webseeds_completion = new StringCompletionModel(file, this);
         webseeds_completion->load();
         m_webseed->setCompleter(new QCompleter(webseeds_completion, this));
 
-        file = kt::DataDir() + "torrent_creator_known_nodes";
+        file = kt::DataDir() + QLatin1String("torrent_creator_known_nodes");
         nodes_completion = new StringCompletionModel(file, this);
         nodes_completion->load();
         m_node->setCompleter(new QCompleter(nodes_completion, this));
@@ -159,11 +160,7 @@ namespace kt
 
     void TorrentCreatorDlg::removeTrackerPressed()
     {
-        QList<QListWidgetItem*> sel = m_tracker_list->selectedItems();
-        foreach (QListWidgetItem* s, sel)
-        {
-            delete s;
-        }
+        qDeleteAll(m_tracker_list->selectedItems());
     }
 
     void TorrentCreatorDlg::moveUpPressed()
@@ -209,9 +206,7 @@ namespace kt
 
     void TorrentCreatorDlg::removeNodePressed()
     {
-        QList<QTreeWidgetItem*> sel = m_node_list->selectedItems();
-        foreach (QTreeWidgetItem* s, sel)
-            delete s;
+        qDeleteAll(m_node_list->selectedItems());
     }
 
     void TorrentCreatorDlg::dhtToggled(bool on)
@@ -253,7 +248,7 @@ namespace kt
             return;
         }
 
-        if (url.scheme() != "http")
+        if (url.scheme() != QLatin1String("http"))
         {
             KMessageBox::error(this, i18n("Only HTTP is supported for \
webseeding."));  return;
@@ -266,11 +261,7 @@ namespace kt
 
     void TorrentCreatorDlg::removeWebSeedPressed()
     {
-        QList<QListWidgetItem*> sel = m_webseed_list->selectedItems();
-        foreach (QListWidgetItem* s, sel)
-        {
-            delete s;
-        }
+        qDeleteAll(m_webseed_list->selectedItems());
     }
 
     void TorrentCreatorDlg::webSeedTextChanged(const QString& str)
@@ -321,7 +312,7 @@ namespace kt
             for (int i = 0; i < m_node_list->topLevelItemCount(); ++i)
             {
                 QTreeWidgetItem* item = m_node_list->topLevelItem(i);
-                trackers.append(item->text(0) + "," +  item->text(1));
+                trackers.append(item->text(0) + ',' +  item->text(1));
             }
         }
         else
@@ -375,8 +366,8 @@ namespace kt
             return;
         }
 
-        if (!s.endsWith(".torrent"))
-            s += ".torrent";
+        if (!s.endsWith(QLatin1String(".torrent")))
+            s += QLatin1String(".torrent");
 
         mktor->saveTorrent(s);
         bt::TorrentInterface* tc = core->createTorrent(mktor, \
                m_start_seeding->isChecked());
diff --git a/ktorrent/gui.cpp b/ktorrent/gui.cpp
index 55d727d..0bdf8fc 100644
--- a/ktorrent/gui.cpp
+++ b/ktorrent/gui.cpp
@@ -264,8 +264,8 @@ namespace kt
 
     void GUI::createTorrent()
     {
-        TorrentCreatorDlg dlg(core, this, this);
-        dlg.exec();
+        TorrentCreatorDlg* dlg = new TorrentCreatorDlg(core, this, this);
+        dlg->show();
     }
 
     void GUI::openTorrentSilently()
@@ -351,24 +351,18 @@ namespace kt
 
     void GUI::showStatusBar()
     {
-        if (show_status_bar_action->isChecked())
-            status_bar->show();
-        else
-            status_bar->hide();
+        status_bar->setVisible(show_status_bar_action->isChecked());
     }
 
     void GUI::showMenuBar()
     {
-        if (show_menu_bar_action->isChecked())
-            menuBar()->show();
-        else
-            menuBar()->hide();
+        menuBar()->setVisible(show_menu_bar_action->isChecked());
     }
 
     void GUI::showIPFilter()
     {
-        IPFilterWidget dlg(this);
-        dlg.exec();
+        IPFilterWidget* dlg = new IPFilterWidget(this);
+        dlg->show();
     }
 
     void GUI::configureKeys()
@@ -395,8 +389,8 @@ namespace kt
 
     void GUI::import()
     {
-        ImportDialog dlg(core, this);
-        dlg.exec();
+        ImportDialog* dlg = new ImportDialog(core, this);
+        dlg->show();
     }
 
     void GUI::setupActions()
@@ -586,5 +580,3 @@ namespace kt
     }
 
 }
-
-#include "gui.moc"
diff --git a/ktorrent/ipfilterwidget.cpp b/ktorrent/ipfilterwidget.cpp
index 930d0c8..83d2971 100644
--- a/ktorrent/ipfilterwidget.cpp
+++ b/ktorrent/ipfilterwidget.cpp
@@ -50,6 +50,7 @@ namespace kt
     IPFilterWidget::IPFilterWidget(QWidget* parent)
         : KDialog(parent)
     {
+        setAttribute(Qt::WA_DeleteOnClose);
         setupUi(mainWidget());
         setButtons(KDialog::None);
         setCaption(i18n("IP Filter List"));
diff --git a/ktorrent/main.cpp b/ktorrent/main.cpp
index 03d2a79..575b0cd 100644
--- a/ktorrent/main.cpp
+++ b/ktorrent/main.cpp
@@ -52,7 +52,7 @@ using namespace bt;
 bool GrabPIDLock()
 {
     // open the PID file in the /tmp directory and attempt to lock it
-    QString pid_file = QString(QDir::tempPath() + \
"/.ktorrent_kde4_%1.lock").arg(getuid()); +    QString pid_file = \
QString(QDir::tempPath() + "/.ktorrent_kf5_%1.lock").arg(getuid());  
     int fd = open(QFile::encodeName(pid_file), O_RDWR | O_CREAT, 0640);
     if (fd < 0)
diff --git a/plugins/shutdown/CMakeLists.txt b/plugins/shutdown/CMakeLists.txt
index d36f773..673e1bf 100644
--- a/plugins/shutdown/CMakeLists.txt
+++ b/plugins/shutdown/CMakeLists.txt
@@ -1,6 +1,6 @@
 set(KWORKSPACE_FOUND FALSE)
-FIND_PATH(KWORKSPACE_INCLUDE_DIR NAMES kworkspace.h PATH_SUFFIXES kworkspace)
-FIND_LIBRARY(KWORKSPACE_LIBRARY NAMES kworkspace)
+FIND_PATH(KWORKSPACE_INCLUDE_DIR NAMES kworkspace.h PATH_SUFFIXES kworkspace5)
+FIND_LIBRARY(KWORKSPACE_LIBRARY NAMES kworkspace5)
 
 if(KWORKSPACE_INCLUDE_DIR AND KWORKSPACE_LIBRARY)
 	set(KWORKSPACE_FOUND TRUE)
@@ -14,9 +14,6 @@ if(KWORKSPACE_INCLUDE_DIR AND KWORKSPACE_LIBRARY)
 	#kconfig_add_kcfg_files(ktshutdownplugin_SRC logviewerpluginsettings.kcfgc)
 	add_library(ktshutdownplugin MODULE ${ktshutdownplugin_SRC})
 	
-	set(NEW_SOLID_POWERMANAGEMENT FALSE)
-	macro_ensure_version("4.5.82" ${KDE_VERSION} NEW_SOLID_POWERMANAGEMENT)
-	
 	target_link_libraries(
 		ktshutdownplugin
 		ktcore


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

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