From 0f4d91d154bf49b7ee22f3fc9826e4e262dcec93 Mon Sep 17 00:00:00 2001 From: Dirk H Bartley Date: Thu, 28 May 2009 12:17:28 +0000 Subject: [PATCH] There was an issue with empty directories. The director would print 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 | 8 ++++++-- bacula/src/qt-console/restore/restore.h | 1 + 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/bacula/src/qt-console/restore/restore.cpp b/bacula/src/qt-console/restore/restore.cpp index 32c30a04bf..b349fdefea 100644 --- a/bacula/src/qt-console/restore/restore.cpp +++ b/bacula/src/qt-console/restore/restore.cpp @@ -112,12 +112,16 @@ void restorePage::fillDirectory() m_console->write_dir(m_conn, "dir", false); QList 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 */ diff --git a/bacula/src/qt-console/restore/restore.h b/bacula/src/qt-console/restore/restore.h index 355f118711..92f972f665 100644 --- a/bacula/src/qt-console/restore/restore.h +++ b/bacula/src/qt-console/restore/restore.h @@ -109,6 +109,7 @@ private: QString m_cwd; QHash m_dirPaths; QHash m_dirTreeItems; + QRegExp m_rx; }; -- 2.39.5