[Digikam-devel] extragear/graphics/digikam
Gilles Caulier
caulier.gilles at gmail.com
Tue May 19 12:12:16 BST 2009
SVN commit 969949 by cgilles:
Warnings : sound like to use KTemporaryFile under windows is bugous if no prefix is set as lead temp folder.
Under Linux, no problem : KDE tmp dir is used properly, but under windows, it's doesn't work. I don't know why...
So, for digiKam welcome page and CSS file, we don't need a temp file. CSS content is just merged with XHTML code
as well, and it's work perfectly...
CCMAIL: digikam-devel at kde.org
M +2 -2 data/about/main.html
M +4 -21 digikam/welcomepageview.cpp
M +0 -6 digikam/welcomepageview.h
--- trunk/extragear/graphics/digikam/data/about/main.html #969948:969949
@@ -8,8 +8,8 @@
<style type="text/css">
/*<![CDATA[*/
- @import "%1"; /* locationCss */
- %2 /* locationRtl */
+ %1 /* Css contents */
+ @import "%2"; /* locationRtl */
body {font-size: %3px;} /* fontSize */
/*]]>*/
</style>
--- trunk/extragear/graphics/digikam/digikam/welcomepageview.cpp #969948:969949
@@ -47,7 +47,6 @@
#include <klocale.h>
#include <kshortcut.h>
#include <kstandarddirs.h>
-#include <ktemporaryfile.h>
#include <ktoolinvocation.h>
#include <kurl.h>
@@ -63,8 +62,6 @@
WelcomePageView::WelcomePageView(QWidget* parent)
: KHTMLPart(parent)
{
- m_infoPageCssFile = 0;
-
widget()->setFocusPolicy(Qt::WheelFocus);
// Let's better be paranoid and disable plugins (it defaults to enabled):
setPluginsEnabled(false);
@@ -91,8 +88,6 @@
WelcomePageView::~WelcomePageView()
{
- if (m_infoPageCssFile)
- delete m_infoPageCssFile;
}
void WelcomePageView::slotUrlOpen(const KUrl& url)
@@ -255,24 +250,12 @@
.arg(KStandardDirs::locate("data", "digikam/about/box-bottom-right.png")) // %17
.arg(KStandardDirs::locate("data", "digikam/about/box-bottom-middle.png")); // %18
- m_infoPageCssFile->open();
- QTextStream stream(m_infoPageCssFile);
- stream << infoPageCss;
- QString cssFile = m_infoPageCssFile->fileName();
- m_infoPageCssFile->close();
- return cssFile;
+ return infoPageCss;
}
void WelcomePageView::slotThemeChanged()
{
- if (m_infoPageCssFile)
- delete m_infoPageCssFile;
-
- m_infoPageCssFile = new KTemporaryFile;
- m_infoPageCssFile->setSuffix(".css");
- m_infoPageCssFile->setAutoRemove(true);
-
- QString locationCss = updateInfoPageCss();
+ QString infoPageCss = updateInfoPageCss();
QString fontSize = QString::number(12);
QString appTitle = i18n("digiKam");
QString slogan = digiKamSlogan().toString();
@@ -284,14 +267,14 @@
begin(KUrl(locationHtml));
QString content = fileToString(locationHtml);
- content = content.arg(locationCss) // %1
+ content = content.arg(infoPageCss) // %1
.arg(rtl) // %2
.arg(fontSize) // %3
.arg(appTitle) // %4
.arg(slogan) // %5
.arg(infoPage()); // %6
- //kDebug(50003) << content << endl;
+ //qDebug() << content << endl;
write(content);
end();
--- trunk/extragear/graphics/digikam/digikam/welcomepageview.h #969948:969949
@@ -39,8 +39,6 @@
#include "digikam_export.h"
-class KTemporaryFile;
-
namespace Digikam
{
@@ -64,10 +62,6 @@
void slotUrlOpen(const KUrl&);
void slotThemeChanged();
-
-private:
-
- KTemporaryFile *m_infoPageCssFile;
};
} // namespace Digikam
More information about the Digikam-devel
mailing list