[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: branches/work/kfontinst/kcmfontinst
From: Craig Drummond <craig () kde ! org>
Date: 2009-04-04 22:25:02
Message-ID: 1238883902.633594.22354.nullmailer () svn ! kde ! org
[Download RAW message or body]
SVN commit 949327 by craig:
itsCurrentFile is in CJobRunner...
M +43 -43 JobRunner.cpp
M +1 -0 JobRunner.h
--- branches/work/kfontinst/kcmfontinst/JobRunner.cpp #949326:949327
@@ -57,46 +57,6 @@
static const int constDownloadFailed=-1;
-static QString errorString(const KUrl &url, int value)
-{
- Misc::TFont font(FC::decode(url));
- QString urlStr;
-
- if(font.family.isEmpty())
- urlStr=url.prettyUrl();
- else
- urlStr=FC::createName(font.family, font.styleInfo);
-
- switch(value)
- {
- case constDownloadFailed:
- return i18n("Failed to download %1", urlStr);
- case FontInst::STATUS_SERVICE_DIED:
- return i18n("Backend died");
- case FontInst::STATUS_BITMAPS_DISABLED:
- return i18n("%1 is a bitmap font, and these have been disabled on your \
system.", urlStr);
- case FontInst::STATUS_ALREADY_INSTALLED:
- return i18n("%1 contains the font <b>%2</b>, which is already installed \
on your system.", urlStr,
- FC::getName(itsCurrentFile));
- case FontInst::STATUS_NOT_FONT_FILE:
- return i18n("%1 is not a font.", urlStr);
- case FontInst::STATUS_PARTIAL_DELETE:
- return i18n("Could not remove all files associated with %1", urlStr);
- case KIO::ERR_FILE_ALREADY_EXIST:
- return i18n("%1 already exists.", urlStr);
- case KIO::ERR_DOES_NOT_EXIST:
- return i18n("%1 does not exist.", urlStr);
- case KIO::ERR_WRITE_ACCESS_DENIED:
- return i18n("Permission denied.\n %1", urlStr);
- case KIO::ERR_UNSUPPORTED_ACTION:
- return i18n("Unsupported action!\n %1", urlStr);
- case KIO::ERR_COULD_NOT_AUTHENTICATE:
- return i18n("Authentication failed.");
- default:
- return i18n("Unexpected error whilst processing: %1", urlStr);
- }
-}
-
class CSkipDialog : public KDialog
{
public:
@@ -330,7 +290,7 @@
// Check if type is Type1, and next is not afm...
itsCurrentFile=fileName((*itsIt).url());
- if(fn.isEmpty()) // Failed to download...
+ if(itsCurrentFile.isEmpty()) // Failed to download...
dbusStatus(getpid(), constDownloadFailed);
else
dbus()->install(itsCurrentFile, false, itsDestIsSystem, \
getpid(), (unsigned int)window()->winId(), false); @@ -421,11 +381,11 @@
if(1==itsUrls.count() || next==itsEnd)
{
if(!itsAutoSkip)
- KMessageBox::error(this, errorString(*itsIt, status));
+ KMessageBox::error(this, errorString(status));
}
else
{
- CSkipDialog dlg(this, true, errorString(*itsIt, status));
+ CSkipDialog dlg(this, true, errorString(status));
switch(dlg.go())
{
@@ -502,6 +462,46 @@
}
}
+QString CJobRunner::errorString(int value) const
+{
+ Misc::TFont font(FC::decode(*itsIt));
+ QString urlStr;
+
+ if(font.family.isEmpty())
+ urlStr=(*itsIt).prettyUrl();
+ else
+ urlStr=FC::createName(font.family, font.styleInfo);
+
+ switch(value)
+ {
+ case constDownloadFailed:
+ return i18n("Failed to download %1", urlStr);
+ case FontInst::STATUS_SERVICE_DIED:
+ return i18n("Backend died");
+ case FontInst::STATUS_BITMAPS_DISABLED:
+ return i18n("%1 is a bitmap font, and these have been disabled on your \
system.", urlStr); + case FontInst::STATUS_ALREADY_INSTALLED:
+ return i18n("%1 contains the font <b>%2</b>, which is already installed \
on your system.", urlStr, + FC::getName(itsCurrentFile));
+ case FontInst::STATUS_NOT_FONT_FILE:
+ return i18n("%1 is not a font.", urlStr);
+ case FontInst::STATUS_PARTIAL_DELETE:
+ return i18n("Could not remove all files associated with %1", urlStr);
+ case KIO::ERR_FILE_ALREADY_EXIST:
+ return i18n("%1 already exists.", urlStr);
+ case KIO::ERR_DOES_NOT_EXIST:
+ return i18n("%1 does not exist.", urlStr);
+ case KIO::ERR_WRITE_ACCESS_DENIED:
+ return i18n("Permission denied.\n %1", urlStr);
+ case KIO::ERR_UNSUPPORTED_ACTION:
+ return i18n("Unsupported action!\n %1", urlStr);
+ case KIO::ERR_COULD_NOT_AUTHENTICATE:
+ return i18n("Authentication failed.");
+ default:
+ return i18n("Unexpected error whilst processing: %1", urlStr);
+ }
+}
+
CJobRunner::Item::Item(const KUrl &u, const QString &n)
: KUrl(u), name(n), fileName(Misc::getFile(u.path()))
{
--- branches/work/kfontinst/kcmfontinst/JobRunner.h #949326:949327
@@ -95,6 +95,7 @@
private:
QString fileName(const KUrl &url);
+ QString errorString(int value) const;
private:
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic