From: Hamatoma Date: Tue, 4 Oct 2016 21:26:36 +0000 (+0200) Subject: rebackgui + reimgconvert X-Git-Url: https://gitweb.hamatoma.de/?a=commitdiff_plain;h=7529a597e5c3ead389e4fe763e760392132c3bfa;p=reqt rebackgui + reimgconvert * rebackgui: ** Button "Make first" * reimgconvert: ** check of the input fields ** target dir is ignored in source tree ** translations completed --- diff --git a/appl/rebackgui/mainwindow.cpp b/appl/rebackgui/mainwindow.cpp index a172085..da6b02f 100644 --- a/appl/rebackgui/mainwindow.cpp +++ b/appl/rebackgui/mainwindow.cpp @@ -223,6 +223,8 @@ void MainWindow::initializeGui(){ connect(ui->pushButtonStop, SIGNAL(clicked()), this, SLOT(onStop())); connect(ui->pushButtonAddItem, SIGNAL(clicked()), this, SLOT(onAddItem())); connect(ui->pushButtonDeleteItem, SIGNAL(clicked()), this, SLOT(onDeleteItem())); + connect(ui->pushButtonMakeFirst, SIGNAL(clicked()), this, SLOT(onMakeFirst())); + connect(ui->pushButtonAddSource, SIGNAL(clicked()), this, SLOT(onAddSource())); connect(ui->pushButtonDeleteSource, SIGNAL(clicked()), this, SLOT(onDeleteSource())); connect(ui->pushButtonSelectTarget, SIGNAL(clicked()), this, SLOT(onSelectTarget())); @@ -617,6 +619,31 @@ void MainWindow::onLoadConfig(){ m_configuration.load(""); updateTable(); } + +/** + * Swaps the current item with the first item. + */ +void MainWindow::onMakeFirst() +{ + int row = ui->tableWidgetConfiguration->selectionModel()->currentIndex().row(); + if (row == 0){ + say(LOG_WARNING, "That's already the first entry. I do nothing"); + } else if (row > 0){ + BackupItem current = m_configuration.items()[row]; + BackupItem currentFirst = m_configuration.items()[0]; + currentFirst.m_no = row + 1; + current.m_no = 1; + m_configuration.items()[0] = current; + m_configuration.items()[row] = currentFirst; + m_configuration.check(); + updateTable(); + updateItem(0); + updateItem(row); + if (ui->checkBoxAutoSave->isChecked()) + onSaveConfig(); + } +} + /** * Loads the configuration file. */ diff --git a/appl/rebackgui/mainwindow.hpp b/appl/rebackgui/mainwindow.hpp index ffc2893..e86a9a0 100644 --- a/appl/rebackgui/mainwindow.hpp +++ b/appl/rebackgui/mainwindow.hpp @@ -73,6 +73,7 @@ private slots: void onGerman(); virtual void onGuiTimerUpdate(); virtual void onLanguageChange(); + void onMakeFirst(); void onSaveConfig(); void onStart(); void onSelectionChanged(const QItemSelection& prior, const QItemSelection& later); diff --git a/appl/rebackgui/mainwindow.ui b/appl/rebackgui/mainwindow.ui index 5bbe079..f70c237 100644 --- a/appl/rebackgui/mainwindow.ui +++ b/appl/rebackgui/mainwindow.ui @@ -434,6 +434,19 @@ + + + + + 125 + 0 + + + + Make first + + + diff --git a/appl/reimgconvert/converter.cpp b/appl/reimgconvert/converter.cpp index 0f391a0..03a25da 100644 --- a/appl/reimgconvert/converter.cpp +++ b/appl/reimgconvert/converter.cpp @@ -489,7 +489,10 @@ void TaskConverter::run(){ + exc.message()); } preSize = max(1LL, preSize); - msg = QObject::tr("%1 of %2 file(s) converted, %3 -> %4 (%5 %), duration: %6") + if (m_totalFiles == 0) + msg = QObject::tr("0 files converted"); + else + msg = QObject::tr("%1 of %2 file(s) converted, %3 -> %4 (%5 %), duration: %6") .arg(no).arg(m_totalFiles) .arg(ReQStringUtils::readableSize(preSize)) .arg(ReQStringUtils::readableSize(postSize)) @@ -501,16 +504,21 @@ void TaskConverter::run(){ /** * Constructor. * + * @param target the target directory which must be ignored as source * @param directory the base directory to inspect * @param sourcePattern the pattern of the image files to convert * @param mainWindow the parent */ -TaskSearch::TaskSearch(const QString& directory, +TaskSearch::TaskSearch(const QString& target, const QString& directory, const QString& sourcePattern, bool recursive, MainWindow* mainWindow) : Converter(directory, mainWindow), m_sourcePattern(sourcePattern), - m_recursive(recursive) + m_target(), + m_recursive(recursive), + m_mainWindow(mainWindow) { + QFileInfo info(target); + m_target = info.canonicalFilePath(); } /** @@ -521,41 +529,47 @@ TaskSearch::TaskSearch(const QString& directory, * @param dir the directory to inspect */ void TaskSearch::processOneDirectory(const QString& dir){ - QDirIterator it(dir); - QRegExp regExpr(m_sourcePattern, Qt::CaseInsensitive, QRegExp::Wildcard); - QString relPath; - QString info; - if (dir.length() > m_sourceDir.length()){ - relPath = dir.mid(m_sourceDir.length() + 1) + OS_SEPARATOR_STR; - } - while (it.hasNext()){ - if (m_shouldStop){ - break; - } - it.next(); - if (! it.fileInfo().isDir() && regExpr.indexIn(it.fileName()) >= 0){ - info = relPath + "\t" + it.fileName(); - m_mutex.lock(); - m_files.append(info); - m_totalFiles++; - m_totalBytes += it.fileInfo().size(); - m_mutex.unlock(); - } - } - if (m_recursive && ! m_shouldStop){ - QDirIterator it2(dir); - QString node; - while (it2.hasNext()){ - if (m_shouldStop){ - break; - } - it2.next(); + QFileInfo info(dir); + if (info.canonicalFilePath() == m_target){ + m_mainWindow->log(QObject::tr("target directory ignored as source:") + + " " + info.canonicalFilePath()); + } else { + QDirIterator it(dir); + QRegExp regExpr(m_sourcePattern, Qt::CaseInsensitive, QRegExp::Wildcard); + QString relPath; + QString info; + if (dir.length() > m_sourceDir.length()){ + relPath = dir.mid(m_sourceDir.length() + 1) + OS_SEPARATOR_STR; + } + while (it.hasNext()){ + if (m_shouldStop){ + break; + } + it.next(); + if (! it.fileInfo().isDir() && regExpr.indexIn(it.fileName()) >= 0){ + info = relPath + "\t" + it.fileName(); + m_mutex.lock(); + m_files.append(info); + m_totalFiles++; + m_totalBytes += it.fileInfo().size(); + m_mutex.unlock(); + } + } + if (m_recursive && ! m_shouldStop){ + QDirIterator it2(dir); + QString node; + while (it2.hasNext()){ + if (m_shouldStop){ + break; + } + it2.next(); - if (it2.fileInfo().isDir() && (node = it2.fileName()) != "." && node != ".."){ - processOneDirectory(it2.filePath()); - } - } - } + if (it2.fileInfo().isDir() && (node = it2.fileName()) != "." && node != ".."){ + processOneDirectory(it2.filePath()); + } + } + } + } } /** diff --git a/appl/reimgconvert/converter.hpp b/appl/reimgconvert/converter.hpp index 733c001..a2e3224 100644 --- a/appl/reimgconvert/converter.hpp +++ b/appl/reimgconvert/converter.hpp @@ -104,15 +104,18 @@ private: class TaskSearch : public Converter { public: - TaskSearch(const QString& dir, const QString& sourcePattern, - bool recursive, MainWindow* mainWindows); + TaskSearch(const QString& target, const QString& dir, + const QString& sourcePattern, + bool recursive, MainWindow* mainWindow); protected: virtual void run(); protected: void processOneDirectory(const QString& dir); private: QString m_sourcePattern; + QString m_target; bool m_recursive; + MainWindow* m_mainWindow; }; class TaskShowOther : public Converter { diff --git a/appl/reimgconvert/mainwindow.cpp b/appl/reimgconvert/mainwindow.cpp index a42dd26..40409cc 100644 --- a/appl/reimgconvert/mainwindow.cpp +++ b/appl/reimgconvert/mainwindow.cpp @@ -15,7 +15,7 @@ #include "ui_mainwindow.h" #include "aboutdialog.hpp" -const QString VERSION("2016.06.26"); +const QString VERSION("2016.10.04"); /** @class MainWindow mainwindow.hpp "mainwindow.hpp" * @@ -93,6 +93,63 @@ void MainWindow::onAboutToQuit(){ saveState(); } +/** + * Tests whether the parameter for execution are complete. + * + * @return trueno error + */ +bool MainWindow::checkArguments() +{ + bool rc = false; + if (ui->tabWidget->currentIndex() == TAB_QUICK){ + if (ui->comboBoxMaxHeight->currentText().isEmpty()) + error(tr("missing maximal height")); + else if (ui->comboBoxMaxWidth->currentText().isEmpty()) + error(tr("missing maximal width")); + else + rc = true; + } else { + if (ui->comboBoxLandscapeX->currentText().isEmpty() + && ui->comboBoxLandscapeY->currentText().isEmpty()) + error(tr("missing data of landscape format: define maximal width or maximal height")); + else if (ui->comboBoxPortraitX->currentText().isEmpty() + && ui->comboBoxPortraitY->currentText().isEmpty()) + error(tr("missing data of portrait format: define maximal width or maximal height")); + else if (ui->comboBoxSquareX->currentText().isEmpty()) + error(tr("missing data of square format: define maximal width/height")); + else + rc = true; + } + if (rc){ + rc = false; + QString source = ui->comboBoxSourceDir->currentText(); + QFileInfo info(source); + QString canonicalSource = info.canonicalFilePath(); + QString target = ui->comboBoxTargetDir->currentText(); + QFileInfo infoTarget(target); + QString canonicalTarget = infoTarget.canonicalFilePath(); + if (source.isEmpty()) + error (tr("missing source directory")); + else if (! ReFileUtils::isAbsolutPath(source)) + error (tr("source is not an absolute directory name:") + " " + source); + else if (! QFileInfo::exists(canonicalSource)) + error(tr("source directory does not exist:") + " " + canonicalSource); + else if (! info.isDir()) + error(tr("source is not a directory:") + " " + source); + else if (target.isEmpty()) + error (tr("missing target directory")); + else if (! ReFileUtils::isAbsolutPath(target)) + error (tr("target is not an absolute directory name:") + " " + target); + else if (QFileInfo::exists(canonicalTarget) && ! infoTarget.isDir()) + error(tr("target is not a directory:") + " " + target); + else if (canonicalSource == canonicalTarget) + error(tr("target is the same as the source:") + " " + canonicalSource); + else + rc = true; + } + return rc; +} + /** * Clears the table. */ @@ -173,38 +230,50 @@ bool MainWindow::log(const QString& message){ * @brief Handles the button click on "convert". */ void MainWindow::onConvert(){ - Converter::m_shouldStop = false; - startStop(true); - m_errors = 0; - int landscapeX = comboInt(ui->comboBoxLandscapeX, 0, "*", 0); - int landscapeY = comboInt(ui->comboBoxLandscapeY, 0, "*", 0); - int portraitX = comboInt(ui->comboBoxPortraitX, 0, "*", 0); - int portraitY = comboInt(ui->comboBoxPortraitY, 0, "*", 0); - int squareX = comboInt(ui->comboBoxSquareX, 0); - int quality = comboInt(ui->comboBoxQuality, 75); - int maxWidth = comboInt(ui->comboBoxMaxWidth, 0); - int maxHeight = comboInt(ui->comboBoxMaxHeight, 0); - QRegularExpressionMatch match = QRegularExpression("\\dx\\d").match( - ui->comboBoxTemplate->currentText()); - bool simpleConversion = match.hasMatch(); - if (m_errors == 0){ - saveState(); - delete m_taskSearch; - m_taskSearch = new TaskSearch(ui->comboBoxSourceDir->currentText(), - ui->comboBoxSourcePattern->currentText(), - ui->checkBoxRecursive->isChecked(), this); - m_taskSearch->start(); + if (checkArguments()){ + Converter::m_shouldStop = false; + startStop(true); + m_errors = 0; + int landscapeX, landscapeY, portraitX, portraitY, squareX; + int quality, maxWidth, maxHeight; + bool simpleConversion = ui->tabWidget->currentIndex() == TAB_QUICK; + if (simpleConversion){ + portraitX = landscapeX = 0; + portraitY = landscapeY = 0; + squareX = 0; + quality = comboInt(ui->comboBoxQuality, 75); + maxWidth = comboInt(ui->comboBoxMaxWidth, 0); + maxHeight = comboInt(ui->comboBoxMaxHeight, 0); + } else { + landscapeX = comboInt(ui->comboBoxLandscapeX, 0, "*", 0); + landscapeY = comboInt(ui->comboBoxLandscapeY, 0, "*", 0); + portraitX = comboInt(ui->comboBoxPortraitX, 0, "*", 0); + portraitY = comboInt(ui->comboBoxPortraitY, 0, "*", 0); + squareX = comboInt(ui->comboBoxSquareX, 0); + quality = comboInt(ui->comboBoxQuality, 75); + maxWidth = 0; + maxHeight = 0; + } + if (m_errors == 0){ + saveState(); + delete m_taskSearch; + m_taskSearch = new TaskSearch(ui->comboBoxTargetDir->currentText(), + ui->comboBoxSourceDir->currentText(), + ui->comboBoxSourcePattern->currentText(), + ui->checkBoxRecursive->isChecked(), this); + m_taskSearch->start(); - delete m_taskConvert; - m_taskConvert = new TaskConverter(ui->comboBoxSourceDir->currentText(), - ui->comboBoxTargetDir->currentText(), - ui->comboBoxSourcePattern->currentText(), - ui->comboBoxDestType->currentText(), - simpleConversion, maxWidth, maxHeight, - landscapeX, landscapeY, portraitX, - portraitY, squareX, quality, this); - m_taskConvert->start(); - } + delete m_taskConvert; + m_taskConvert = new TaskConverter(ui->comboBoxSourceDir->currentText(), + ui->comboBoxTargetDir->currentText(), + ui->comboBoxSourcePattern->currentText(), + ui->comboBoxDestType->currentText(), + simpleConversion, maxWidth, maxHeight, + landscapeX, landscapeY, portraitX, + portraitY, squareX, quality, this); + m_taskConvert->start(); + } + } } /** diff --git a/appl/reimgconvert/mainwindow.hpp b/appl/reimgconvert/mainwindow.hpp index 4e1cfae..b58a23d 100644 --- a/appl/reimgconvert/mainwindow.hpp +++ b/appl/reimgconvert/mainwindow.hpp @@ -27,7 +27,8 @@ class MainWindow: public ReGuiApplication, public ReGuiValidator, public ConvertLogger { Q_OBJECT - +public: + enum { TAB_QUICK, TAB_DETAIL }; public: explicit MainWindow(QApplication& application, const QString& homeDir, QWidget *parent = 0); ~MainWindow(); @@ -39,6 +40,7 @@ public: public: virtual bool say(ReLoggerLevel level, const QString& message); private: + bool checkArguments(); void restoreState(); void saveState(); void setMaxDimensions(int maxWidth, int maxHeight);public slots: diff --git a/appl/reimgconvert/mainwindow.ui b/appl/reimgconvert/mainwindow.ui index 0e7cc75..c8087bc 100644 --- a/appl/reimgconvert/mainwindow.ui +++ b/appl/reimgconvert/mainwindow.ui @@ -48,7 +48,7 @@ 11 11 561 - 30 + 38 @@ -137,7 +137,7 @@ 13 62 560 - 30 + 38 @@ -177,6 +177,9 @@ true + + 1024 + @@ -215,6 +218,9 @@ true + + 768 + @@ -261,7 +267,7 @@ 2 30 234 - 65 + 81 @@ -301,6 +307,9 @@ true + + + @@ -339,6 +348,9 @@ true + + + @@ -368,7 +380,7 @@ 3 31 234 - 65 + 81 @@ -408,6 +420,9 @@ true + + + @@ -446,6 +461,9 @@ true + + + @@ -493,6 +511,9 @@ true + + + @@ -571,6 +592,9 @@ true + + 80 + @@ -612,6 +636,9 @@ true + + *.jpg + *.jpg @@ -773,7 +800,7 @@ true - + @@ -997,7 +1024,7 @@ 0 0 958 - 26 + 30 diff --git a/appl/reimgconvert/reimgconvert.de.qm b/appl/reimgconvert/reimgconvert.de.qm index 864e62c..7601e77 100644 Binary files a/appl/reimgconvert/reimgconvert.de.qm and b/appl/reimgconvert/reimgconvert.de.qm differ diff --git a/appl/reimgconvert/reimgconvert.de.ts b/appl/reimgconvert/reimgconvert.de.ts index 48e0279..240cdb0 100644 --- a/appl/reimgconvert/reimgconvert.de.ts +++ b/appl/reimgconvert/reimgconvert.de.ts @@ -1,6 +1,6 @@ - + AboutDialog @@ -98,240 +98,310 @@ p, li { white-space: pre-wrap; } - - + + Max. Width: Max. Breite: - - - + + + Max. Height: Max. Höhe: - + Dimensions (separated) Auflösung (getrennt) - + Portrait: Hochformat: - + Landscape: Breitformat: - + Square: Quadrat: - + Max. Width/Height: Max. Breite/Höhe: - + Quality (%): Qualität (%): - + Quality of the image. Only relevant for *.jpg Qualität des Bildes. Nur relevant für *.jpg - + File Pattern: Dateimuster: - + A pattern of the source files with wildcards '*' (anything) and '?' (exact one char) Ein Muster der Quelldateien mit Joker '*' (beliebiger String) und '?' (genau ein Zeichen) - + Dest. Type: Zieldateityp: - + Source Directory (Images): Quellverzeichnis (der Bilddateien): - + Destination: Ziel: - + The converted files will built here Die konvertierten Dateien werden hier erstellt - + Process the subdirectories too Auch Unterverzeichnisse werden behandelt - + Recursive Rekursiv - + Files not matching the file pattern will be copied too (and not ignored) Dateien, die nicht auf das Dateimuster passen werden auch kopiert (und nicht ignoriert) - + Copy other files Kopiere andere Dateien - + Show other files Zeige andere Dateien - + Converts the images Konvertiere die Bilder - + &Convert Konvertiere - - + + Clears the list Löscht die Liste - - + + C&lear &Löschen - + Stops the conversion Hält die Konversion an - + &Stop Halt - + &File Datei - + &Help &Hilfe - + toolBar_2 - + Convert Konvertiere - + Converts all images from the source directory into the target directory Konvertiert alle Bilder vom Quellverzeichnis ins Zielverzeichnis - - + + Select the source directory Wahl eines Quellverzeichnis - + Select Destination Wahl des Zielverzeichnisses - - + + Select the destination directory Wahl des Zielverzeichnisses - + The target images will have this format (and file extension) Die Zielbilder werden in diesem Format (und mit dieser Dateiendung) gespeichert - + The files will fetched from here Die Bilder werden von hier geholt - + + Select Source + Wähle Quelle + + + Sto&p Halt - + Stopps the conversion Hält die Konversion an - + &Exit B&enden - + Terminates the program Beendet das Program - + &About Über - + Info about the program Information über das Program - + Ctrl+Shift+X Ctrl+Shift+A - + Ctrl+Shift+X + + + + missing maximal height + Maximale Höhe nicht eingetragen + + + + missing maximal width + Maximale Breite nicht eingetragen + + + + missing data of landscape format: define maximal width or maximal height + Vermisse Angabe im Breitformat: definiere maximale Breite oder maximale Höhe + + + + missing data of portrait format: define maximal width or maximal height + Vermisse Angabe im Hochformat: definiere maximale Breite oder maximale Höhe + + + + missing data of square format: define maximal width/height + Vermisse Angabe im Quadratformat: definiere maximale Breite / Höhe + + + + missing source directory + Quellverzeichnis nicht angegeben + + + + source is not an absolute directory name: + Die Quelle hat keinen absoluten Verzeichnisnamen: + + + + source directory does not exist: + Das Quellverzeichnis existiert nicht: - + + source is not a directory: + Die Quelle ist kein Verzeichnis: + + + + missing target directory + Zielverzeichnis nicht angegeben + + + + target is not an absolute directory name: + Das Ziel hat keinen absoluten Verzeichnisnamen: + + + + target is not a directory: + Das Ziel ist kein Verzeichnis: + + + + target is the same as the source: + Das Ziel ist das gleiche Verzeichnis wie die Quelle: + + + Select Source Directory Wahl des Quellverzeichnisses - + Reading data from Daten werden gelesen von - + Select Destination Directory Wahl des Zielverzeichnisses @@ -353,48 +423,75 @@ Erwartet: %2 Ausführung wegen Fehler angehalten - + + 0 files converted + 0 Dateien konvertiert + + + %1 of %2 file(s) converted, %3 -> %4 (%5 %), duration: %6 %1 von %2 Datei(en) konvertiert, %3 -> %4 (%5 %), Dauer: %6 - + + target directory ignored as source: + target directory ignored as source: + Das Zielverzeichnis wurde als Quelle ignoriert: + + + + copy file failed (%1): %2 + Kopieren missglückt (%1): %2 + + + not found: %1 Nicht gefunden: %1 - - + + not a regular file: %1 + Keine normale Datei: %1 + + + + cannot open (%1): %2 Kann nicht öffnen (%1): %2 - + cannot write (%1): %2 [%3/%4] Kann nicht schreiben (%1): %2 [%3/%4] - + file can be read only partitionally: %1 [%2/%3] Datei kann nur teilweise gelesen werden: %1 [%2/%3] - + cannot set date/time (%1): %2 Kann Datum/Zeit nicht setzen (%1): %2 - + cannot set permissions (%1): %2 Kann Dateirechte nicht setzen (%1): %2 [%3/%4] - + + cannot set user/gid [%1/%2] (%3): %4 + Kann Benutzer/Gruppe nicht setzen:[%1/%2] (%3): %4 + + + + can't create directory (%1): %2 Kann Verzeichnis nicht erzeugen (%1): %2 [%3/%4] - + can't create directory (is a file): Kann Verzeichnis nicht erstellen (ist eine Datei): @@ -498,7 +595,7 @@ Erwartet: %2 TaskShowOther - + Found: %1 file(s) Gefunden: %1 Datei(en) diff --git a/base/ReFileUtils.cpp b/base/ReFileUtils.cpp index 5815b74..0bfafe8 100644 --- a/base/ReFileUtils.cpp +++ b/base/ReFileUtils.cpp @@ -20,6 +20,7 @@ enum { LOC_MAKE_DIR_1, // 12505 LOC_MAKE_DIR_2, // 12506 LOC_SET_TIMES_2, // 12507 + LOC_MAKE_DIR_WITH_PARENT_1, // 12508 }; int ReFileUtils::m_maxCharSet = 128; bool ReFileUtils::m_ignoreSetUidError = false; @@ -638,7 +639,7 @@ ReSuccess_t ReFileUtils::makeDirWithParents(const char* path, ReLogger* logger) QByteArray dir = parentOf(path); ReStringUtils::chomp(dir, OS_SEPARATOR); if (stat(dir.constData(), &info) == 0 && S_ISDIR(info.st_mode)) - rc = makeDir(path, logger); + rc = makeDir(path, NULL); else { const char* end; const char* start = path; @@ -657,16 +658,20 @@ ReSuccess_t ReFileUtils::makeDirWithParents(const char* path, ReLogger* logger) continue; } #endif - rc = makeDir(dir.constData(), logger); + rc = makeDir(dir.constData(), NULL); dir += OS_SEPARATOR; } } if (rc && start[0] != '\0') { dir.append(start); - rc = makeDir(dir.constData(), logger); + rc = makeDir(dir.constData(), NULL); } } } + if (! rc) + logger->log(LOG_ERROR, LOC_MAKE_DIR_WITH_PARENT_1, + QObject::tr("can't create directory (%1): %2").arg(errno) + .arg(path)); return rc; } @@ -1244,6 +1249,8 @@ void ReMountInfo::load() QRegularExpression regExpr("^(.*?) on (.*) type "); QString line; QString directory; + m_deviceOfMountPoint.clear(); + m_mountPointOfDevice.clear(); for (int ix = 0; ix < lines.size(); ix++){ if (lines[ix][0] != OS_SEPARATOR) continue; @@ -1293,7 +1300,7 @@ ReMountInfo& ReMountInfo::instance(bool forceLoad){ else if (forceLoad) m_instance->load(); - return *m_instance; + return *m_instance; } /** @@ -1311,7 +1318,7 @@ ReSuccess_t ReMountInfo::mount(const QString& device, const QString& path, args << "/bin/mount" << device << path; QByteArray error; ReSuccess_t rc = ReProcess::executeSilent("/usr/bin/sudo", args, 30, &error); - if (! rc &&& announcer != NULL) + if (! rc && announcer != NULL) announcer->say(LOG_ERROR, QString(error)); return rc; } @@ -1411,6 +1418,7 @@ void ReBlockDevices::load(){ " UUID=\"([^\"]+)\"" " TYPE=\"([^\"]+)\""); QString line; + m_devices.clear(); for (int ix = 0; ix < lines.size(); ix++){ line = I18N::b2s(lines.at(ix)); QRegularExpressionMatch match = regExpr2.match(line);