diff options
| author | Peter Penz <[email protected]> | 2012-04-17 22:19:18 +0200 |
|---|---|---|
| committer | Peter Penz <[email protected]> | 2012-04-17 22:21:55 +0200 |
| commit | beeb9078f543af84e6364f1f5fe214453388f1b9 (patch) | |
| tree | a233ca14a66e67896642e723b89870ed4ecb3181 /src/panels | |
| parent | 9f94aac23f8b6519de4847063fa20f588f9797ea (diff) | |
Ensure authentication data is cached properly
The attached patch sets the main window on the main directory
lister in DolphinView and KIO jobs in DolphinMainWindow to ensure
that login data for remote protocols such as sftp, ftp are cached
properly for the duration of the application. Otherwise, the end
user is going to end up being unnecessarily re-prompted to enter
password login information.
Thanks to Dawit Alemayehu for the patch!
REVIEW: 104614
FIXED-IN: 4.9.0
Diffstat (limited to 'src/panels')
| -rw-r--r-- | src/panels/information/informationpanel.cpp | 4 | ||||
| -rw-r--r-- | src/panels/information/informationpanel.h | 6 | ||||
| -rw-r--r-- | src/panels/information/informationpanelcontent.cpp | 4 | ||||
| -rw-r--r-- | src/panels/search/searchpanel.cpp | 6 | ||||
| -rw-r--r-- | src/panels/search/searchpanel.h | 13 | ||||
| -rw-r--r-- | src/panels/terminal/terminalpanel.cpp | 4 |
6 files changed, 30 insertions, 7 deletions
diff --git a/src/panels/information/informationpanel.cpp b/src/panels/information/informationpanel.cpp index 3b4747b77..eda74f3b5 100644 --- a/src/panels/information/informationpanel.cpp +++ b/src/panels/information/informationpanel.cpp @@ -21,6 +21,7 @@ #include "informationpanelcontent.h" #include <KIO/Job> +#include <KIO/JobUiDelegate> #include <KDirNotify> #include <QApplication> #include <QShowEvent> @@ -182,6 +183,9 @@ void InformationPanel::showItemInfo() // No item is hovered and no selection has been done: provide // an item for the currently shown directory. m_folderStatJob = KIO::stat(url(), KIO::HideProgressInfo); + if (m_folderStatJob->ui()) { + m_folderStatJob->ui()->setWindow(this); + } connect(m_folderStatJob, SIGNAL(result(KJob*)), this, SLOT(slotFolderStatFinished(KJob*))); } else { diff --git a/src/panels/information/informationpanel.h b/src/panels/information/informationpanel.h index 8a7ad6bb7..c68b66ee1 100644 --- a/src/panels/information/informationpanel.h +++ b/src/panels/information/informationpanel.h @@ -23,6 +23,10 @@ #include <panels/panel.h> class InformationPanelContent; +namespace KIO +{ + class Job; +} /** * @brief Panel for showing meta information of one ore more selected items. @@ -147,7 +151,7 @@ private: KFileItem m_fileItem; // file item for m_shownUrl if available (otherwise null) KFileItemList m_selection; - KJob* m_folderStatJob; + KIO::Job* m_folderStatJob; InformationPanelContent* m_content; }; diff --git a/src/panels/information/informationpanelcontent.cpp b/src/panels/information/informationpanelcontent.cpp index a82319ef9..4a96bd1b6 100644 --- a/src/panels/information/informationpanelcontent.cpp +++ b/src/panels/information/informationpanelcontent.cpp @@ -24,6 +24,7 @@ #include <kfilemetadatawidget.h> #include <KFilePlacesModel> #include <KGlobalSettings> +#include <KIO/JobUiDelegate> #include <KIO/PreviewJob> #include <KIconEffect> #include <KIconLoader> @@ -176,6 +177,9 @@ void InformationPanelContent::showItem(const KFileItem& item) KIO::PreviewJob* job = new KIO::PreviewJob(KFileItemList() << item, QSize(m_preview->width(), m_preview->height())); job->setScaleType(KIO::PreviewJob::Unscaled); job->setIgnoreMaximumSize(item.isLocalFile()); + if (job->ui()) { + job->ui()->setWindow(this); + } connect(job, SIGNAL(gotPreview(KFileItem,QPixmap)), this, SLOT(showPreview(KFileItem,QPixmap))); diff --git a/src/panels/search/searchpanel.cpp b/src/panels/search/searchpanel.cpp index a78828e0d..fd4195f54 100644 --- a/src/panels/search/searchpanel.cpp +++ b/src/panels/search/searchpanel.cpp @@ -38,8 +38,9 @@ #include <search/dolphinsearchinformation.h> #include <KFileItem> -#include <KIO/JobClasses> #include <KIO/Job> +#include <KIO/JobClasses> +#include <KIO/JobUiDelegate> #include <KMenu> #include <QPushButton> @@ -101,6 +102,9 @@ bool SearchPanel::urlChanged() // Reset the current query and disable the facet-widget until // the new query has been determined by KIO::stat(): m_lastSetUrlStatJob = KIO::stat(url(), KIO::HideProgressInfo); + if (m_lastSetUrlStatJob->ui()) { + m_lastSetUrlStatJob->ui()->setWindow(this); + } connect(m_lastSetUrlStatJob, SIGNAL(result(KJob*)), this, SLOT(slotSetUrlStatFinished(KJob*))); } else { diff --git a/src/panels/search/searchpanel.h b/src/panels/search/searchpanel.h index ae34b20c6..4ea7e121e 100644 --- a/src/panels/search/searchpanel.h +++ b/src/panels/search/searchpanel.h @@ -23,10 +23,15 @@ #include <Nepomuk/Query/Query> #include <panels/panel.h> -class KJob; +namespace KIO +{ + class Job; +}; -namespace Nepomuk { - namespace Utils { +namespace Nepomuk +{ + namespace Utils + { class FacetWidget; } } @@ -92,7 +97,7 @@ private: private: bool m_initialized; SearchLocation m_searchLocation; - KJob* m_lastSetUrlStatJob; + KIO::Job* m_lastSetUrlStatJob; KUrl m_startedFromDir; Nepomuk::Utils::FacetWidget* m_facetWidget; diff --git a/src/panels/terminal/terminalpanel.cpp b/src/panels/terminal/terminalpanel.cpp index 19c6cb1b7..51df81806 100644 --- a/src/panels/terminal/terminalpanel.cpp +++ b/src/panels/terminal/terminalpanel.cpp @@ -115,7 +115,9 @@ void TerminalPanel::changeDir(const KUrl& url) sendCdToTerminal(url.toLocalFile()); } else { m_mostLocalUrlJob = KIO::mostLocalUrl(url, KIO::HideProgressInfo); - m_mostLocalUrlJob->ui()->setWindow(this); + if (m_mostLocalUrlJob->ui()) { + m_mostLocalUrlJob->ui()->setWindow(this); + } connect(m_mostLocalUrlJob, SIGNAL(result(KJob*)), this, SLOT(slotMostLocalUrlResult(KJob*))); } } |
