]> git.sur5r.net Git - bacula/bacula/commitdiff
There was an issue with empty directories. The director would print
authorDirk H Bartley <dbartley@schupan.com>
Thu, 28 May 2009 12:17:28 +0000 (12:17 +0000)
committerDirk H Bartley <dbartley@schupan.com>
Thu, 28 May 2009 12:17:28 +0000 (12:17 +0000)
node xxx has no children and bat would interpret that as a directory.
This fixes it but it may not be the best solution.

git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@8870 91ce42f0-d328-0410-95d8-f526ca767f89

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

index 32c30a04bf11ba868f1498c803fa9e2f891c0b93..b349fdefea810a41cbf0450898ba6a6fa5a01ba2 100644 (file)
@@ -112,12 +112,16 @@ void restorePage::fillDirectory()
    m_console->write_dir(m_conn, "dir", false);
    QList<QTreeWidgetItem *> treeItemList;
    QStringList item;
+   m_rx.setPattern("has no children\\.$");
+   bool first = true;
    while (m_console->read(m_conn) > 0) {
       char *p = m_console->msg(m_conn);
       char *l;
       strip_trailing_junk(p);
-      if (*p == '$' || !*p) {
-         continue;
+      if (*p == '$' || !*p) { continue; }
+      if (first) {
+         if (m_rx.indexIn(QString(p)) != -1) { continue; }
+         first = false;
       }
       l = p;
       skip_nonspaces(&p);             /* permissions */
index 355f118711d08464b890a5c39dd423ae09e59287..92f972f66554e4849110dcef17d19ce86d6a8fc5 100644 (file)
@@ -109,6 +109,7 @@ private:
    QString m_cwd;
    QHash<QString, QTreeWidgetItem *> m_dirPaths;
    QHash<QTreeWidgetItem *,QString> m_dirTreeItems;
+   QRegExp m_rx;
 };