From 79a6e75b6567e8cf2ef677cea6bb2c34075d07c7 Mon Sep 17 00:00:00 2001 From: Peter Penz Date: Sat, 1 Aug 2009 21:11:29 +0000 Subject: [PATCH] Assure that no empty error message is shown in the statusbar. This should not happen and the fix in this case should be done in the corresponding IO-slave, but let's be prepared for the "worst case". svn path=/trunk/KDE/kdebase/apps/; revision=1005715 --- src/dolphindirlister.cpp | 11 ++++++++--- src/dolphindirlister.h | 9 +++------ 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/src/dolphindirlister.cpp b/src/dolphindirlister.cpp index 63320b528..43196bb21 100644 --- a/src/dolphindirlister.cpp +++ b/src/dolphindirlister.cpp @@ -1,6 +1,5 @@ /*************************************************************************** - * Copyright (C) 2006 by Peter Penz * - * peter.penz@gmx.at * + * Copyright (C) 2006-2009 by Peter Penz * * * * 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 * @@ -19,6 +18,7 @@ ***************************************************************************/ #include "dolphindirlister.h" +#include "klocale.h" #include DolphinDirLister::DolphinDirLister() : @@ -35,7 +35,12 @@ void DolphinDirLister::handleError(KIO::Job* job) if (job->error() == KIO::ERR_IS_FILE) { emit urlIsFileError(url()); } else { - emit errorMessage(job->errorString()); + const QString errorString = job->errorString(); + if (errorString.isEmpty()) { + emit errorMessage(i18nc("@info:status", "Unknown error.")); + } else { + emit errorMessage(job->errorString()); + } } } diff --git a/src/dolphindirlister.h b/src/dolphindirlister.h index b615f63ba..6723d19b6 100644 --- a/src/dolphindirlister.h +++ b/src/dolphindirlister.h @@ -1,6 +1,5 @@ /*************************************************************************** - * Copyright (C) 2006 by Peter Penz * - * peter.penz@gmx.at * + * Copyright (C) 2006-2009 by Peter Penz * * * * 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 * @@ -24,10 +23,8 @@ #include /** - * @brief Extends the class KDirLister by emitting an error - * signal containing text. - * - * @author Peter Penz + * @brief Extends the class KDirLister by emitting a signal when an + * error occured instead of showing an error dialog. */ class DolphinDirLister : public KDirLister { -- 2.47.3