Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package QTalarm for openSUSE:Factory checked in at 2026-07-21 23:10:47 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/QTalarm (Old) and /work/SRC/openSUSE:Factory/.QTalarm.new.24530 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "QTalarm" Tue Jul 21 23:10:47 2026 rev:13 rq:1366883 version:3.1.0 Changes: -------- --- /work/SRC/openSUSE:Factory/QTalarm/QTalarm.changes 2025-10-27 14:43:51.641078075 +0100 +++ /work/SRC/openSUSE:Factory/.QTalarm.new.24530/QTalarm.changes 2026-07-21 23:11:12.539956173 +0200 @@ -1,0 +2,12 @@ +Tue Jul 21 07:29:11 UTC 2026 - Martin Hauke <[email protected]> + +- Update to version 3.1.0 + * Enable drag-and-drop reordering of alarms. + +------------------------------------------------------------------- +Mon Jul 13 08:16:55 UTC 2026 - Martin Hauke <[email protected]> + +- Update to version 3.0.2 + * Fixed minor bug for the remove alarm button. + +------------------------------------------------------------------- Old: ---- QTalarm-3.0.1.tar.gz New: ---- QTalarm-3.1.0.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ QTalarm.spec ++++++ --- /var/tmp/diff_new_pack.OVQqIw/_old 2026-07-21 23:11:13.107975593 +0200 +++ /var/tmp/diff_new_pack.OVQqIw/_new 2026-07-21 23:11:13.111975730 +0200 @@ -1,7 +1,7 @@ # # spec file for package QTalarm # -# Copyright (c) 2025 SUSE LLC and contributors +# Copyright (c) 2026 SUSE LLC and contributors # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -18,7 +18,7 @@ %define _name qtalarm Name: QTalarm -Version: 3.0.1 +Version: 3.1.0 Release: 0 Summary: A handy alarm clock Program written in QT License: GPL-3.0-only ++++++ QTalarm-3.0.1.tar.gz -> QTalarm-3.1.0.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/QTalarm-3.0.1/aboutdialog.h new/QTalarm-3.1.0/aboutdialog.h --- old/QTalarm-3.0.1/aboutdialog.h 2025-10-26 18:53:02.000000000 +0100 +++ new/QTalarm-3.1.0/aboutdialog.h 2026-07-19 19:28:49.000000000 +0200 @@ -14,7 +14,7 @@ public: explicit AboutDialog(QWidget *parent = 0); ~AboutDialog(); - const QString version="3.0.1"; + const QString version="3.1.0"; private: Ui::AboutDialog *ui; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/QTalarm-3.0.1/mainwindow.cpp new/QTalarm-3.1.0/mainwindow.cpp --- old/QTalarm-3.0.1/mainwindow.cpp 2025-10-26 18:53:02.000000000 +0100 +++ new/QTalarm-3.1.0/mainwindow.cpp 2026-07-19 19:28:49.000000000 +0200 @@ -30,7 +30,25 @@ { ui->setupUi(this); - if(!QSystemTrayIcon::isSystemTrayAvailable()) + // Enable drag-and-drop reordering for the alarm list + ui->listWidget->setSelectionMode(QAbstractItemView::SingleSelection); + ui->listWidget->setDragEnabled(true); + ui->listWidget->setAcceptDrops(true); + ui->listWidget->setDropIndicatorShown(true); + ui->listWidget->setDragDropMode(QAbstractItemView::InternalMove); + ui->listWidget->setDefaultDropAction(Qt::MoveAction); + + // Persist reordering back to underlying data collection and indices + connect(ui->listWidget->model(), &QAbstractItemModel::rowsMoved, + this, [this](const QModelIndex & /*srcParent*/, int start, int end, + const QModelIndex & /*dstParent*/, int destinationRow) { + if (this->_Schedules) { + this->_Schedules->MoveRange(start, end, destinationRow); + this->_Schedules->Save(); + } + }); + + if(!QSystemTrayIcon::isSystemTrayAvailable()) { qInfo() << "No system tray detected. What a shitty DE"; //what is this 1993? } @@ -452,9 +470,14 @@ { ui->listWidget->clear(); ScheduleModel *sche; + int count =0; foreach(sche,this->_Schedules->GetScheduleList()) { ui->listWidget->addItem(sche->Name()); + count++; + } + if(count==0){ + this->ui->listAlmBtn->button(QDialogButtonBox::Cancel)->setDisabled(true); } ui->listWidget->setCurrentRow(this->_lastDeletedIndex); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/QTalarm-3.0.1/schedules.cpp new/QTalarm-3.1.0/schedules.cpp --- old/QTalarm-3.0.1/schedules.cpp 2025-10-26 18:53:02.000000000 +0100 +++ new/QTalarm-3.1.0/schedules.cpp 2026-07-19 19:28:49.000000000 +0200 @@ -34,10 +34,50 @@ { qInfo() << "Adding new alarm"; this->_Collection.append(scheToAdd); + // set index for newly added schedule + scheToAdd->Index = this->_Collection.size() - 1; } void Schedules::removeScheduleByIndex(int index) { qInfo() << "Removing alarm"; this->_Collection.removeAt(index); + // reindex remaining schedules after removal + Reindex(); +} + +void Schedules::Reindex() +{ + for (int i = 0; i < this->_Collection.size(); ++i) + { + this->_Collection[i]->Index = i; + } +} + +void Schedules::MoveRange(int start, int end, int destinationRow) +{ + if (start < 0 || end >= _Collection.size() || start > end) + return; + int count = end - start + 1; + int to = destinationRow; + // Adjust destination index when moving within the same list + if (to > start) + to -= count; + if (to < 0) to = 0; + if (to > _Collection.size() - count) to = _Collection.size() - count; + + // Extract the block + QList<ScheduleModel*> block; + block.reserve(count); + for (int i = start; i <= end; ++i) + block.append(_Collection[i]); + // Remove the block from original position + for (int i = 0; i < count; ++i) + _Collection.removeAt(start); + // Insert block at new position preserving order + for (int i = 0; i < count; ++i) + _Collection.insert(to + i, block[i]); + + // update indices + Reindex(); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/QTalarm-3.0.1/schedules.h new/QTalarm-3.1.0/schedules.h --- old/QTalarm-3.0.1/schedules.h 2025-10-26 18:53:02.000000000 +0100 +++ new/QTalarm-3.1.0/schedules.h 2026-07-19 19:28:49.000000000 +0200 @@ -16,6 +16,9 @@ void removeScheduleByIndex(int); void LoadSchedules(); void Save(); + // Reorder operations + void MoveRange(int start, int end, int destinationRow); + void Reindex(); private: QList<ScheduleModel*> _Collection; signals:
