From 873a7e4b2e27e205f1f96a1db2cf33febdfa671c Mon Sep 17 00:00:00 2001 From: Kern Sibbald Date: Sat, 5 Jul 2008 12:17:33 +0000 Subject: [PATCH] Update bat restore.cpp git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@7312 91ce42f0-d328-0410-95d8-f526ca767f89 --- bacula/src/qt-console/restore/restore.cpp | 37 ++++++++++++++++------- 1 file changed, 26 insertions(+), 11 deletions(-) diff --git a/bacula/src/qt-console/restore/restore.cpp b/bacula/src/qt-console/restore/restore.cpp index 4da3efde3f..305c374ab2 100644 --- a/bacula/src/qt-console/restore/restore.cpp +++ b/bacula/src/qt-console/restore/restore.cpp @@ -193,19 +193,35 @@ void restorePage::addDirectory(QString &newdirr) Pmsg0(000, msg.toUtf8().data()); } - /* add unix '/' directory first */ - if (m_dirPaths.empty()) { - if (isWin32Path(newdir)) { - /* this is a windows drive */ + if (isWin32Path(newdir)) { + /* this is a windows drive */ + if (mainWin->m_miscDebug) { + Pmsg0(000, "Found windows drive\n"); + } + windrive = true; + } + + if (windrive) { + if (fullpath.left(1) == "/") { + fullpath.replace(0, 1, ""); /* strip leading / */ + } + /* If drive and not already in add it */ + if (fullpath.length() == 3 && !m_dirPaths.contains(fullpath)) { + QTreeWidgetItem *item = new QTreeWidgetItem(directoryWidget); + item->setIcon(0,QIcon(QString::fromUtf8(":images/folder.png"))); + item->setText(0, fullpath.toUtf8().data()); if (mainWin->m_miscDebug) { - Pmsg0(000, "Need to do windows \"letter\":/\n"); + Pmsg1(000, "Pre Inserting %s\n",fullpath.toUtf8().data()); } - fullpath.replace(0,1,""); - windrive = true; - } else { + m_dirPaths.insert(fullpath, item); + m_dirTreeItems.insert(item, fullpath); + } + } else { + // Unix add / first if not already there + if (m_dirPaths.empty()) { 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) { @@ -215,9 +231,8 @@ void restorePage::addDirectory(QString &newdirr) m_dirTreeItems.insert(item, text); } } - - /* is it already existent ?? */ + /* Does it already exist ?? */ if (!m_dirPaths.contains(fullpath)) { QTreeWidgetItem *item = NULL; if (windrive) { -- 2.39.2