]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/qt-console/restore/brestore.cpp
Change copyright as per agreement with FSFE
[bacula/bacula] / bacula / src / qt-console / restore / brestore.cpp
index 980bd8e952b249186819a426d7638db6d5411306..341a99848850938dd63fd6fc0379ddc2422a27e9 100644 (file)
@@ -1,26 +1,29 @@
 /*
-   Bacula® - The Network Backup Solution
+   Bacula(R) - The Network Backup Solution
 
-   Copyright (C) 2007-2011 Free Software Foundation Europe e.V.
+   Copyright (C) 2000-2016 Kern Sibbald
 
-   The main author of Bacula is Kern Sibbald, with contributions from many
-   others, a complete list can be found in the file AUTHORS.
+   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.
 
-   Bacula® is a registered trademark of Kern Sibbald.
-*/
+   This notice must be preserved when any source code is 
+   conveyed and/or propagated.
 
+   Bacula(R) is a registered trademark of Kern Sibbald.
+*/
 /*
  *
  *  bRestore Class  (Eric's brestore)
  *
  *   Kern Sibbald, January MMVII
  *
- */
+ */ 
 
 #include "bat.h"
 #include "restore.h"
@@ -183,7 +186,7 @@ void bRestore::displayFiles(int64_t pathid, QString path)
    LocationEntry->setText(m_path);
    QString offset = QString().setNum(Offset1Spin->value());
    QString limit=QString().setNum(Offset2Spin->value() - Offset1Spin->value());
-   QString q = ".bvfs_lsdir jobid=" + m_jobids + arg
+   QString q = ".bvfs_lsdir jobid=" + m_jobids + arg 
       + " limit=" + limit + " offset=" + offset ;
    if (mainWin->m_miscDebug) qDebug() << q;
    if (m_console->dir_cmd(q, results)) {
@@ -220,7 +223,7 @@ void bRestore::displayFiles(int64_t pathid, QString path)
          fieldlist = resultline.split("\t");
          TableItemFormatter item(*FileList, row++);
          item.setTextFld(col++, fieldlist.at(5)); // name
-         decode_stat(fieldlist.at(4).toLocal8Bit().data(),
+         decode_stat(fieldlist.at(4).toLocal8Bit().data(), 
                      &statp, sizeof(statp), &LinkFI);
          item.setBytesFld(col++, QString().setNum(statp.st_size));
          item.setDateFld(col++, statp.st_mtime);
@@ -245,7 +248,7 @@ void bRestore::PgSeltreeWidgetClicked()
 }
 
 // Display all versions of a file for this client
-void bRestore::displayFileVersion(QString pathid, QString fnid,
+void bRestore::displayFileVersion(QString pathid, QString fnid, 
                                   QString client, QString filename)
 {
    int row=0;
@@ -253,10 +256,10 @@ void bRestore::displayFileVersion(QString pathid, QString fnid,
    int32_t LinkFI;
    Freeze frz_rev(*FileRevisions); /* disable updating*/
    FileRevisions->clearContents();
-
+   
    QString q = ".bvfs_versions jobid=" + m_jobids +
-      " pathid=" + pathid +
-      " fnid=" + fnid +
+      " pathid=" + pathid + 
+      " fnid=" + fnid + 
       " client=" + client;
 
    if (VersionsChk->checkState() == Qt::Checked) {
@@ -274,10 +277,10 @@ void bRestore::displayFileVersion(QString pathid, QString fnid,
          //PathId, FilenameId, fileid, jobid, lstat, Md5, VolName, Inchanger
          fieldlist = resultline.split("\t");
          TableItemFormatter item(*FileRevisions, row++);
-         item.setInChanger(col++, fieldlist.at(7)); // inchanger
+         item.setInChanger(col++, fieldlist.at(7));    // inchanger
          item.setTextFld(col++, fieldlist.at(6)); // Volume
          item.setNumericFld(col++, fieldlist.at(3)); // JobId
-         decode_stat(fieldlist.at(4).toLocal8Bit().data(),
+         decode_stat(fieldlist.at(4).toLocal8Bit().data(), 
                      &statp, sizeof(statp), &LinkFI);
          item.setBytesFld(col++, QString().setNum(statp.st_size)); // size
          item.setDateFld(col++, statp.st_mtime); // date
@@ -343,9 +346,9 @@ void bRestore::setupPage()
    ClientList->addItems(m_console->client_list);
    connect(ClientList, SIGNAL(currentIndexChanged(int)), this, SLOT(setClient()));
    connect(JobList, SIGNAL(currentIndexChanged(int)), this, SLOT(setJob()));
-   connect(FileList, SIGNAL(itemClicked(QTableWidgetItem*)),
+   connect(FileList, SIGNAL(itemClicked(QTableWidgetItem*)), 
            this, SLOT(clearVersions(QTableWidgetItem *)));
-   connect(FileList, SIGNAL(itemDoubleClicked(QTableWidgetItem*)),
+   connect(FileList, SIGNAL(itemDoubleClicked(QTableWidgetItem*)), 
            this, SLOT(showInfoForFile(QTableWidgetItem *)));
    connect(LocationBp, SIGNAL(pressed()), this, SLOT(applyLocation()));
    connect(MergeChk, SIGNAL(clicked()), this, SLOT(setJob()));
@@ -450,7 +453,7 @@ void bRestoreTable::dropEvent(QDropEvent *event)
          item.setFileType(0, "folder");
       }
       item.setTextFld(col++, fields.at(5)); // filename
-      decode_stat(fields.at(4).toLocal8Bit().data(),
+      decode_stat(fields.at(4).toLocal8Bit().data(), 
                   &statp, sizeof(statp), &LinkFI);
       item.setBytesFld(col++, QString().setNum(statp.st_size)); // size
       item.setDateFld(col++, statp.st_mtime); // date
@@ -534,7 +537,7 @@ bRunRestore::bRunRestore(bRestore *parent)
    computeVolumeList();
 }
 
-void bRestore::get_info_from_selection(QStringList &fileids,
+void bRestore::get_info_from_selection(QStringList &fileids, 
                                        QStringList &jobids,
                                        QStringList &dirids,
                                        QStringList &findexes)
@@ -548,7 +551,7 @@ void bRestore::get_info_from_selection(QStringList &fileids,
       if (lst.at(1) != "0") {   // skip path
          fileids << lst.at(2);
          jobids << lst.at(3);
-         decode_stat(lst.at(4).toLocal8Bit().data(),
+         decode_stat(lst.at(4).toLocal8Bit().data(), 
                      &statp, sizeof(statp), &LinkFI);
          if (LinkFI) {
             findexes << lst.at(3) + "," + QString().setNum(LinkFI);
@@ -576,7 +579,7 @@ void bRunRestore::computeVolumeList()
    QString q =
 " SELECT DISTINCT VolumeName, Enabled, InChanger "
  " FROM File, "
-  " ( " // -- Get all media from this job
+  " ( " // -- Get all media from this job 
      " SELECT MIN(FirstIndex) AS FirstIndex, MAX(LastIndex) AS LastIndex, "
             " VolumeName, Enabled, Inchanger "
        " FROM JobMedia JOIN Media USING (MediaId) "
@@ -593,7 +596,7 @@ void bRunRestore::computeVolumeList()
       TableMedia->setRowCount(results.size());
       /* Iterate through the record returned from the query */
       foreach (QString resultline, results) {
-         // 0        1          2
+         // 0        1          2 
          //volname, enabled, inchanger
          fieldlist = resultline.split("\t");
          int col=0;
@@ -671,7 +674,7 @@ int64_t bRunRestore::runRestore(QString tablename)
    q += " file=\"?" + tablename + "\"";
    q += " when=\"" + WhenEditor->dateTime().toString("yyyy-MM-dd hh:mm:ss") + "\"";
    q += " done yes";
-
+   
    if (mainWin->m_miscDebug) qDebug() << q;
    QStringList results;
    if (brestore->console()->dir_cmd(q, results)) {
@@ -707,5 +710,5 @@ void bRunRestore::computeRestore()
          q = ".bvfs_cleanup path=b2123";
          brestore->console()->dir_cmd(q, results);
       }
-   }
+   }   
 }