diff --git a/CMakeLists.txt b/CMakeLists.txt index 62d59d2..d394f7a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 3.16) -project(mossball VERSION 0.1 LANGUAGES CXX) +project(mossball VERSION 1.0 LANGUAGES CXX) set(CMAKE_AUTOUIC ON) set(CMAKE_AUTOMOC ON) diff --git a/src/changelogwidget.cpp b/src/changelogwidget.cpp index cabee7b..4e1f50c 100644 --- a/src/changelogwidget.cpp +++ b/src/changelogwidget.cpp @@ -51,18 +51,20 @@ void ChangelogWidget::on_pushButton_clicked() { minidocx::Zip z; z.open(out.toStdString(), minidocx::Zip::OpenMode::Create); - QRegularExpression ex("^[^ ]* [^ ]*\[.*$"); - QRegularExpression fileex("(?:\\S+\\s+){1}(.+?)(?:\(|$)"); + QRegularExpression ex("^[^ ]* [^ ]*\\[.*$"); + QRegularExpression fileex("^(?:\\S+\\s+){2}(.*?)(?:\\s*\\(|$)"); for (QString i : ui->plainTextEdit->toPlainText().split("\n")) { if (i.length() > 5) { if (QStringList{"+", "*"}.contains(i.first(1))) { - auto temp1 = ex.match(i).hasMatch(); - qWarning()<= 2) { - z.addFileFromDisk(QString("%1/%2").arg(i.split(" ")[1]).arg(fileex.match(i).captured()).toStdString(), QString(work_dir + QString("/%1/%2").arg(i.split(" ")[1]).arg(fileex.match(i).captured())).toStdString()); + // file + auto temp2 = QString(work_dir + QString("/%1/%2").arg(i.split(" ")[1]).arg(fileex.match(i).captured(1))); + qDebug()<close(); } } diff --git a/src/pickerwidget.h b/src/pickerwidget.h index 2910eca..bd4cd9c 100644 --- a/src/pickerwidget.h +++ b/src/pickerwidget.h @@ -51,22 +51,27 @@ class PickerWidget : public QDialog { if (orig.size() < work.size()) { // note non-empty additions in new chunks for (int i = orig.size(); i == work.size(); i++) { - if (work[i-1] != T()){ + if (work[i-1] != T()) { addModelItem(folder, lcfops::id_with_name(i-1, ToQString(work[i-1].name)), "+", 1); } } } else if (orig.size() > work.size()) { // note non-empty removals in removed chunks for (int i = work.size(); i == orig.size(); i++) { - if (orig[i-1] != T()){ + if (orig[i-1] != T()) { addModelItem(folder, lcfops::id_with_name(i-1, ToQString(orig[i-1].name)), "i", 1); } } } // note additions for slots shared between both databases for (int i = 0, total = (work.size() < orig.size() ? orig.size() - 1 : work.size() - 1); i <= total; ++i) { - if (orig[i] != work[i]){ - addModelItem(folder, lcfops::id_with_name(i, ToQString(work[i].name)), lcfops::compare(orig[i], work[i]), 1); + if (orig[i] != work[i]) { + QString comp = lcfops::compare(orig[i], work[i]); + if (comp == "-") { + addModelItem(folder, lcfops::id_with_name(i, ToQString(orig[i].name)), comp, 1); + } else { + addModelItem(folder, lcfops::id_with_name(i, ToQString(work[i].name)), comp, 1); + } } } }