]> git.sur5r.net Git - bacula/bacula/commitdiff
Fix bad handling of c: during restore in bat
authorKern Sibbald <kern@sibbald.com>
Sun, 31 Oct 2010 15:23:43 +0000 (16:23 +0100)
committerKern Sibbald <kern@sibbald.com>
Sun, 31 Oct 2010 15:24:28 +0000 (16:24 +0100)
bacula/src/qt-console/restore/restore.cpp

index 8b3dad760a83bd4fb0f682cf954c94ec85c78e68..b3a5a480dc5f9f4d56ed5685b1970f453ca96451 100644 (file)
@@ -194,25 +194,17 @@ void restorePage::addDirectory(QString &newdirr)
    QString newdir = newdirr;
    QString fullpath = m_cwd + newdirr;
    bool ok = true;
-   bool windrive = false;
 
    if (mainWin->m_miscDebug) {
       QString msg = QString(tr("In addDirectory cwd \"%1\" newdir \"%2\" fullpath \"%3\"\n"))
                     .arg(m_cwd)
                     .arg(newdir)
                     .arg(fullpath);
-      Pmsg0(dbglvl, msg.toUtf8().data());
+      Pmsg1(dbglvl, "%s\n", msg.toUtf8().data());
    }
 
-   if (isWin32Path(newdir)) {
-      /* this is a windows drive */
-      if (mainWin->m_miscDebug) {
-         Pmsg0(dbglvl, "Found windows drive\n");
-      }
-      windrive = true;
-   }
-   
-   if (windrive) {
+   if (isWin32Path(fullpath)) {
+      Pmsg0(dbglvl, "Windows drive\n");
       if (fullpath.left(1) == "/") {
          fullpath.replace(0, 1, "");           /* strip leading / */
       }
@@ -247,10 +239,11 @@ void restorePage::addDirectory(QString &newdirr)
    /* Does it already exist ?? */
    if (!m_dirPaths.contains(fullpath)) {
       QTreeWidgetItem *item = NULL;
-      if (windrive) {
+      if (isWin32Path(fullpath)) {
          /* this is the base widget */
          item = new QTreeWidgetItem(directoryWidget);
          item->setText(0, fullpath.toUtf8().data());
+         Pmsg1(dbglvl, "Windows: %s\n", fullpath.toUtf8().data());
          item->setIcon(0,QIcon(QString::fromUtf8(":images/folder.png")));
       } else {
          QTreeWidgetItem *parent = m_dirPaths.value(m_cwd);
@@ -260,13 +253,14 @@ void restorePage::addDirectory(QString &newdirr)
             item->setText(0, newdir.toUtf8().data());
             item->setIcon(0,QIcon(QString::fromUtf8(":images/folder.png")));
             directoryWidget->expandItem(parent);
+            Pmsg1(dbglvl, "%s\n", newdir.toUtf8().data());
          } else {
             ok = false;
             if (mainWin->m_miscDebug) {
                QString msg = QString(tr("In else of if parent cwd \"%1\" newdir \"%2\"\n"))
                     .arg(m_cwd)
                     .arg(newdir);
-               Pmsg0(dbglvl, msg.toUtf8().data());
+               Pmsg1(dbglvl, "%s\n", msg.toUtf8().data());
             }
          }
       }
@@ -349,13 +343,14 @@ void restorePage::fileDoubleClicked(QTreeWidgetItem *item, int column)
    if (item->text(1).endsWith("/")) {
       QString fullpath = m_cwd + item->text(1);
       QTreeWidgetItem *item = m_dirPaths.value(fullpath);
+      Pmsg1(dbglvl, "%s\n", fullpath.toUtf8().data());
       if (item) {
          directoryWidget->setCurrentItem(item);
       } else {
          QString msg = QString("DoubleClick else of item column %1 fullpath %2\n")
               .arg(column,10)
               .arg(fullpath);
-         Pmsg0(dbglvl, msg.toUtf8().data());
+         Pmsg1(dbglvl, "%s\n", msg.toUtf8().data());
       }
    }
 }