]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/qt-console/restore/restore.cpp
Backport from Bacula Enterprise
[bacula/bacula] / bacula / src / qt-console / restore / restore.cpp
index 8b3dad760a83bd4fb0f682cf954c94ec85c78e68..70cc2992e3eb365dee148172c7bf26b7ec632ff3 100644 (file)
@@ -1,29 +1,21 @@
 /*
-   Bacula® - The Network Backup Solution
+   Bacula(R) - The Network Backup Solution
 
+   Copyright (C) 2000-2015 Kern Sibbald
    Copyright (C) 2007-2010 Free Software Foundation Europe e.V.
 
-   The main author of Bacula is Kern Sibbald, with contributions from
-   many others, a complete list can be found in the file AUTHORS.
-   This program is Free Software; you can redistribute it and/or
-   modify it under the terms of version three of the GNU Affero General Public
-   License as published by the Free Software Foundation and included
-   in the file LICENSE.
-
-   This program is distributed in the hope that it will be useful, but
-   WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-   General Public License for more details.
-
-   You should have received a copy of the GNU Affero General Public License
-   along with this program; if not, write to the Free Software
-   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-   02110-1301, USA.
-
-   Bacula® is a registered trademark of Kern Sibbald.
-   The licensor of Bacula is the Free Software Foundation Europe
-   (FSFE), Fiduciary Program, Sumatrastrasse 25, 8006 Zürich,
-   Switzerland, email:ftf@fsfeurope.org.
+   The original author of Bacula is Kern Sibbald, with contributions
+   from many others, a complete list can be found in the file AUTHORS.
+
+   You may use this file and others of this release according to the
+   license defined in the LICENSE file, which includes the Affero General
+   Public License, v3.0 ("AGPLv3") and some additional permissions and
+   terms pursuant to its AGPLv3 Section 7.
+
+   This notice must be preserved when any source code is 
+   conveyed and/or propagated.
+
+   Bacula(R) is a registered trademark of Kern Sibbald.
 */
  
 /*
@@ -38,7 +30,7 @@
 
 static const int dbglvl = 100;
 
-restorePage::restorePage(int conn)
+restorePage::restorePage(int conn) : Pages()
 {
    Dmsg1(dbglvl, "Construcing restorePage Instance connection %i\n", conn);
    m_conn = conn;
@@ -194,25 +186,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)) {
+      if (mainWin->m_miscDebug) Pmsg0(dbglvl, "Windows drive\n");
       if (fullpath.left(1) == "/") {
          fullpath.replace(0, 1, "");           /* strip leading / */
       }
@@ -247,10 +231,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());
+         if (mainWin->m_miscDebug) 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 +245,16 @@ void restorePage::addDirectory(QString &newdirr)
             item->setText(0, newdir.toUtf8().data());
             item->setIcon(0,QIcon(QString::fromUtf8(":images/folder.png")));
             directoryWidget->expandItem(parent);
+            if (mainWin->m_miscDebug) {
+               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 +337,16 @@ 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);
+      if (mainWin->m_miscDebug) {
+         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());
+         if (mainWin->m_miscDebug) Pmsg1(dbglvl, "%s\n", msg.toUtf8().data());
       }
    }
 }