[SCM] Kingston update notifier (update-notifier-kde) branch, master, updated. 862db1d11ceb303e2f3cb2fcab3ad7ebbdd74453

Pino Toscano pino-guest at alioth.debian.org
Wed May 12 21:29:02 UTC 2010


The following commit has been merged in the master branch:
commit 862db1d11ceb303e2f3cb2fcab3ad7ebbdd74453
Author: Pino Toscano <pino at kde.org>
Date:   Wed May 12 23:28:21 2010 +0200

    avoid a global static instance of a non-POD type (QString)
    
    make 'reboot_required_path' a static char[], creating a latin1 string from it when needed
---
 src/reboot_listener.cpp |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/reboot_listener.cpp b/src/reboot_listener.cpp
index efd8c87..c252248 100644
--- a/src/reboot_listener.cpp
+++ b/src/reboot_listener.cpp
@@ -31,11 +31,11 @@
 #include <QTimer>
 #include <QFile>
 
-static const QString reboot_required_path = "/var/run/reboot-required";
+static const char reboot_required_path[] = "/var/run/reboot-required";
 
 reboot_listener_t::reboot_listener_t(QObject* parent): QObject(parent) {
   m_watcher = new KDirWatch(this);
-  m_watcher->addFile(reboot_required_path);
+  m_watcher->addFile(QString::fromLatin1(reboot_required_path));
   connect(m_watcher,SIGNAL(created(QString)),this,SLOT(directory_changed_slot(QString)));
   m_timer = new QTimer(this);
   m_timer->setSingleShot(true);
@@ -43,14 +43,14 @@ reboot_listener_t::reboot_listener_t(QObject* parent): QObject(parent) {
   connect(m_timer,SIGNAL(timeout()),SIGNAL(request_reboot()));
 }
 void reboot_listener_t::check_for_reboot() {
-  if(QFile::exists(reboot_required_path)) {
+  if(QFile::exists(QString::fromLatin1(reboot_required_path))) {
     m_timer->start();
   }
 }
 
 
 void reboot_listener_t::directory_changed_slot(const QString& path) {
-  if(path==reboot_required_path) {
+  if(path==QLatin1String(reboot_required_path)) {
      m_timer->start();
   }
 }

-- 
Kingston update notifier (update-notifier-kde)



More information about the pkg-kde-commits mailing list