Fixed svgviewer hacks for builtin files
authorClifford Wolf <clifford@clifford.at>
Thu, 28 Mar 2013 09:47:35 +0000 (10:47 +0100)
committerClifford Wolf <clifford@clifford.at>
Thu, 28 Mar 2013 09:47:35 +0000 (10:47 +0100)
libs/svgviewer/mainwindow.cpp

index 9c4aa23f8ce8eb12aa3922d810615942874af57d..b352ff9f79f853843c1655847ae92d0f6cd2e7d7 100644 (file)
@@ -141,19 +141,20 @@ void MainWindow::openFile(const QString &path, bool reload)
             return;
         }
 
-       m_watcher = new QFileSystemWatcher(this);
-       m_watcher->addPath(fileName);
-       connect(m_watcher, SIGNAL(fileChanged(const QString&)), this, SLOT(reloadFile()));
-
-       // just keep the file open so this process is found using 'fuser'
-       m_filehandle = fopen(fileName.toAscii(), "r");
-
        QTransform oldTransform = m_view->transform();
         m_view->openFile(file);
 
-        if (!fileName.startsWith(":/")) {
+        if (!fileName.startsWith(":/"))
+       {
             m_currentPath = fileName;
             setWindowTitle(tr("%1 - SVGViewer").arg(m_currentPath));
+
+           // just keep the file open so this process is found using 'fuser'
+           m_filehandle = fopen(fileName.toAscii(), "r");
+
+           m_watcher = new QFileSystemWatcher(this);
+           m_watcher->addPath(fileName);
+           connect(m_watcher, SIGNAL(fileChanged(const QString&)), this, SLOT(reloadFile()));
         }
 
         m_outlineAction->setEnabled(true);