]> git.sur5r.net Git - bacula/bacula/commitdiff
This is the same changes made to the head to fix being able to use the restore class
authorDirk H Bartley <dbartley@schupan.com>
Sun, 1 Jun 2008 14:31:37 +0000 (14:31 +0000)
committerDirk H Bartley <dbartley@schupan.com>
Sun, 1 Jun 2008 14:31:37 +0000 (14:31 +0000)
from both unix and windows type file systems.  (ie c:/ preceeding)

git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/branches/Branch-2.2@7085 91ce42f0-d328-0410-95d8-f526ca767f89

bacula/src/qt-console/console/console.cpp
bacula/src/qt-console/pages.cpp
bacula/src/qt-console/restore/restore.cpp

index 77106b2bb86c87b893a3513caeeca0e3b103eb2c..58f175e5ba5201f6605d5557e0a8ac56185bb24d 100644 (file)
@@ -617,7 +617,7 @@ int Console::read()
             break;
          } 
          app->processEvents();
-         if (m_api_set && m_messages_pending) {
+         if (m_api_set && m_messages_pending && m_notifier->isEnabled()) {
             write_dir(".messages");
             m_messages_pending = false;
          }
index 59c5143e59ce7e3122734a99e77aa2c74ba9d85d..051e5873a7b423a1c94695565c6011f4ad267b0a 100644 (file)
@@ -39,7 +39,15 @@ bool isWin32Path(QString &fullPath)
 {
    char *buf = fullPath.left(2).toUtf8().data();
 
-   return buf[1] == ':' && B_ISALPHA(buf[0]);
+   //bool toret = B_ISALPHA(buf[1]);
+   bool toret = buf[1] == ':' && B_ISALPHA(buf[0]);
+   if (mainWin->m_miscDebug) {
+      if (toret)
+         Pmsg1(000, "returning from isWin32Path true %s\n", fullPath.toUtf8().data());
+      else
+         Pmsg1(000, "returning from isWin32Path false %s\n", fullPath.toUtf8().data());
+   }
+   return toret;
 }
 
 
index 73661b4e06a6856e0f8f56ae35e2ab689cacf462..542b2a9881fcbbe3dfafb6a7230a249dfc9c437f 100644 (file)
@@ -185,34 +185,36 @@ void restorePage::addDirectory(QString &newdirr)
    bool windrive = false;
 
    if (mainWin->m_miscDebug) {
-      QString msg = QString("In addDirectory cwd \"%1\" newdir \"%2\"\n")
+      QString msg = QString(tr("In addDirectory cwd \"%1\" newdir \"%2\" fullpath \"%3\"\n"))
                     .arg(m_cwd)
-                    .arg(newdir);
+                    .arg(newdir)
+                    .arg(fullpath);
       Pmsg0(000, msg.toUtf8().data());
    }
 
    /* add unix '/' directory first */
-   if (m_dirPaths.empty() && !isWin32Path(fullpath)) {
-      QTreeWidgetItem *item = new QTreeWidgetItem(directoryWidget);
-      item->setIcon(0,QIcon(QString::fromUtf8(":images/folder.png")));
-      
-      QString text("/");
-      item->setText(0, text.toUtf8().data());
-      if (mainWin->m_miscDebug) {
-         Pmsg1(000, "Pre Inserting %s\n",text.toUtf8().data());
-      }
-      m_dirPaths.insert(text, item);
-      m_dirTreeItems.insert(item, text);
-   }
+   if (m_dirPaths.empty()) {
+      if (isWin32Path(newdir)) {
+         /* this is a windows drive */
+         if (mainWin->m_miscDebug) {
+            Pmsg0(000, "Need to do windows \"letter\":/\n");
+         }
+         fullpath.replace(0,1,"");
+         windrive = true;
+      } else {
+         QTreeWidgetItem *item = new QTreeWidgetItem(directoryWidget);
+         item->setIcon(0,QIcon(QString::fromUtf8(":images/folder.png")));
 
-   if (isWin32Path(fullpath)) {
-      /* this is a windows drive */
-      if (mainWin->m_miscDebug) {
-         Pmsg0(000, "Need to do windows \"letter\":/\n");
+         QString text("/");
+         item->setText(0, text.toUtf8().data());
+         if (mainWin->m_miscDebug) {
+            Pmsg1(000, "Pre Inserting %s\n",text.toUtf8().data());
+         }
+         m_dirPaths.insert(text, item);
+         m_dirTreeItems.insert(item, text);
       }
-      windrive = true;
    }
+
    /* is it already existent ?? */
    if (!m_dirPaths.contains(fullpath)) {
       QTreeWidgetItem *item = NULL;