┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/kitemviews/private
diff options
context:
space:
mode:
authorPeter Penz <[email protected]>2012-06-13 15:15:54 +0200
committerPeter Penz <[email protected]>2012-06-13 15:18:21 +0200
commite9463ffe2ac110193cac4c25fcba887249f52b3c (patch)
tree2628af56647926efc845086dc46b95650e89f1d2 /src/kitemviews/private
parentfb15dac9752b44ceb0846ac013160d8972c5e862 (diff)
Fix regression: Open file if entering it in the URL-navigator
The regression has been introduced when hiding the DolphinDirLister inside KFileItemModel. Now the signal urlIsFileError() gets forwarded to the container again where the file will be opened. BUG: 301757 FIXED-IN: 4.9.0
Diffstat (limited to 'src/kitemviews/private')
-rw-r--r--src/kitemviews/private/kfileitemmodeldirlister.cpp12
-rw-r--r--src/kitemviews/private/kfileitemmodeldirlister.h6
2 files changed, 14 insertions, 4 deletions
diff --git a/src/kitemviews/private/kfileitemmodeldirlister.cpp b/src/kitemviews/private/kfileitemmodeldirlister.cpp
index be0f9f77b..3d36386a9 100644
--- a/src/kitemviews/private/kfileitemmodeldirlister.cpp
+++ b/src/kitemviews/private/kfileitemmodeldirlister.cpp
@@ -33,11 +33,15 @@ KFileItemModelDirLister::~KFileItemModelDirLister()
void KFileItemModelDirLister::handleError(KIO::Job* job)
{
- const QString errorString = job->errorString();
- if (errorString.isEmpty()) {
- emit errorMessage(i18nc("@info:status", "Unknown error."));
+ if (job->error() == KIO::ERR_IS_FILE) {
+ emit urlIsFileError(url());
} else {
- emit errorMessage(errorString);
+ const QString errorString = job->errorString();
+ if (errorString.isEmpty()) {
+ emit errorMessage(i18nc("@info:status", "Unknown error."));
+ } else {
+ emit errorMessage(errorString);
+ }
}
}
diff --git a/src/kitemviews/private/kfileitemmodeldirlister.h b/src/kitemviews/private/kfileitemmodeldirlister.h
index 1d58347f4..688ee9c5b 100644
--- a/src/kitemviews/private/kfileitemmodeldirlister.h
+++ b/src/kitemviews/private/kfileitemmodeldirlister.h
@@ -40,6 +40,12 @@ signals:
/** Is emitted whenever an error has occurred. */
void errorMessage(const QString& msg);
+ /**
+ * Is emitted when the URL of the directory lister represents a file.
+ * In this case no signal errorMessage() will be emitted.
+ */
+ void urlIsFileError(const KUrl& url);
+
protected:
virtual void handleError(KIO::Job* job);
};