Delete all selected rows, not just half.

develop 0.14.5
tastytea 2019-01-15 01:37:55 +01:00
parent 229c3f6645
commit 59466c5f9e
No known key found for this signature in database
GPG Key ID: CFC39497F1B26E07
4 changed files with 27 additions and 24 deletions

View File

@ -1,6 +1,6 @@
cmake_minimum_required (VERSION 3.2) cmake_minimum_required (VERSION 3.2)
project (whyblocked project (whyblocked
VERSION 0.14.4 VERSION 0.14.5
LANGUAGES CXX LANGUAGES CXX
) )

View File

@ -196,8 +196,11 @@ void MainWindow::remove()
QItemSelectionModel *selection = tableview->selectionModel(); QItemSelectionModel *selection = tableview->selectionModel();
if (selection->hasSelection()) if (selection->hasSelection())
{ {
for (auto &row : selection->selectedRows()) // I use this construct here because the number of selected rows
// decrease by 1 each iteration.
for (; selection->selectedRows().count() > 0;)
{ {
const QModelIndex row = selection->selectedRows().front();
const string user = row.data().toString().toStdString(); const string user = row.data().toString().toStdString();
_database.remove(user); _database.remove(user);
_model->removeRow(row.row()); _model->removeRow(row.row());

View File

@ -198,7 +198,7 @@
</message> </message>
<message> <message>
<location filename="../src/qt/whyblocked.ui" line="285"/> <location filename="../src/qt/whyblocked.ui" line="285"/>
<location filename="../src/qt/mainwindow.cpp" line="275"/> <location filename="../src/qt/mainwindow.cpp" line="277"/>
<source>Edit entry</source> <source>Edit entry</source>
<translation>Eintrag bearbeiten</translation> <translation>Eintrag bearbeiten</translation>
</message> </message>
@ -219,18 +219,18 @@
</message> </message>
<message> <message>
<location filename="../src/qt/whyblocked.ui" line="59"/> <location filename="../src/qt/whyblocked.ui" line="59"/>
<location filename="../src/qt/mainwindow.cpp" line="325"/> <location filename="../src/qt/mainwindow.cpp" line="327"/>
<source>User/Instance</source> <source>User/Instance</source>
<translation>Benutzer/Instanz</translation> <translation>Benutzer/Instanz</translation>
</message> </message>
<message> <message>
<location filename="../src/qt/mainwindow.cpp" line="326"/> <location filename="../src/qt/mainwindow.cpp" line="328"/>
<source>Blocked/Silenced</source> <source>Blocked/Silenced</source>
<translation>Blockiert/Gedämpft</translation> <translation>Blockiert/Gedämpft</translation>
</message> </message>
<message> <message>
<location filename="../src/qt/whyblocked.ui" line="72"/> <location filename="../src/qt/whyblocked.ui" line="72"/>
<location filename="../src/qt/mainwindow.cpp" line="327"/> <location filename="../src/qt/mainwindow.cpp" line="329"/>
<source>Reason</source> <source>Reason</source>
<translation>Begründung</translation> <translation>Begründung</translation>
</message> </message>
@ -250,37 +250,37 @@
<translation>gedämpft</translation> <translation>gedämpft</translation>
</message> </message>
<message> <message>
<location filename="../src/qt/mainwindow.cpp" line="269"/> <location filename="../src/qt/mainwindow.cpp" line="271"/>
<source>Invalid selection</source> <source>Invalid selection</source>
<translation>Ungültige Auswahl</translation> <translation>Ungültige Auswahl</translation>
</message> </message>
<message> <message>
<location filename="../src/qt/mainwindow.cpp" line="270"/> <location filename="../src/qt/mainwindow.cpp" line="272"/>
<source>Please select only 1 entry to edit.</source> <source>Please select only 1 entry to edit.</source>
<translation>Bitte nur 1 Eintrag zum bearbeiten auswählen.</translation> <translation>Bitte nur 1 Eintrag zum bearbeiten auswählen.</translation>
</message> </message>
<message> <message>
<location filename="../src/qt/mainwindow.cpp" line="209"/> <location filename="../src/qt/mainwindow.cpp" line="211"/>
<source>Nothing selected</source> <source>Nothing selected</source>
<translation>Nichts ausgewählt</translation> <translation>Nichts ausgewählt</translation>
</message> </message>
<message> <message>
<location filename="../src/qt/mainwindow.cpp" line="210"/> <location filename="../src/qt/mainwindow.cpp" line="212"/>
<source>Please select entries to remove.</source> <source>Please select entries to remove.</source>
<translation>Bitte wähle Einträge aus, die gelöscht werden sollen.</translation> <translation>Bitte wähle Einträge aus, die gelöscht werden sollen.</translation>
</message> </message>
<message> <message>
<location filename="../src/qt/mainwindow.cpp" line="288"/> <location filename="../src/qt/mainwindow.cpp" line="290"/>
<source>About Whyblocked</source> <source>About Whyblocked</source>
<translation>Über Whyblocked</translation> <translation>Über Whyblocked</translation>
</message> </message>
<message> <message>
<location filename="../src/qt/mainwindow.cpp" line="289"/> <location filename="../src/qt/mainwindow.cpp" line="291"/>
<source>&lt;p&gt;&lt;b&gt;Whyblocked&lt;/b&gt; %1&lt;/p&gt;&lt;p&gt;Reminds you why you blocked someone.&lt;/p&gt;&lt;p&gt;Sourcecode: &lt;a href=&quot;https://schlomp.space/tastytea/whyblocked&quot;&gt;https://schlomp.space/tastytea/whyblocked&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;small&gt;Copyright © 2018 &lt;a href=&quot;mailto:tastytea@tastytea.de&quot;&gt;tastytea&lt;/a&gt;.&lt;br&gt;Licence GPLv3: &lt;a href=&quot;https://www.gnu.org/licenses/gpl-3.0.html&quot;&gt;GNU GPL version 3&lt;/a&gt;.&lt;br&gt;This program comes with ABSOLUTELY NO WARRANTY. This is free software, and you are welcome to redistribute it under certain conditions.&lt;/small&gt;&lt;/p&gt;</source> <source>&lt;p&gt;&lt;b&gt;Whyblocked&lt;/b&gt; %1&lt;/p&gt;&lt;p&gt;Reminds you why you blocked someone.&lt;/p&gt;&lt;p&gt;Sourcecode: &lt;a href=&quot;https://schlomp.space/tastytea/whyblocked&quot;&gt;https://schlomp.space/tastytea/whyblocked&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;small&gt;Copyright © 2018 &lt;a href=&quot;mailto:tastytea@tastytea.de&quot;&gt;tastytea&lt;/a&gt;.&lt;br&gt;Licence GPLv3: &lt;a href=&quot;https://www.gnu.org/licenses/gpl-3.0.html&quot;&gt;GNU GPL version 3&lt;/a&gt;.&lt;br&gt;This program comes with ABSOLUTELY NO WARRANTY. This is free software, and you are welcome to redistribute it under certain conditions.&lt;/small&gt;&lt;/p&gt;</source>
<translation>&lt;p&gt;&lt;b&gt;Whyblocked&lt;/b&gt; %1&lt;/p&gt;&lt;p&gt;Erinnert dich, warum du jemanden blockiertest.&lt;/p&gt;&lt;p&gt;Quelltext: &lt;a href=&quot;https://schlomp.space/tastytea/whyblocked&quot;&gt;https://schlomp.space/tastytea/whyblocked&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;small&gt;Copyright © 2018 &lt;a href=&quot;mailto:tastytea@tastytea.de&quot;&gt;tastytea&lt;/a&gt;.&lt;br&gt;Lizenz GPLv3: &lt;a href=&quot;https://www.gnu.org/licenses/gpl-3.0.html&quot;&gt;GNU GPL version 3&lt;/a&gt;.&lt;br&gt;Für dieses Programm besteht KEINERLEI GARANTIE. Dies ist freie Software, die Sie unter bestimmten Bedingungen weitergeben dürfen.&lt;/small&gt;&lt;/p&gt;</translation> <translation>&lt;p&gt;&lt;b&gt;Whyblocked&lt;/b&gt; %1&lt;/p&gt;&lt;p&gt;Erinnert dich, warum du jemanden blockiertest.&lt;/p&gt;&lt;p&gt;Quelltext: &lt;a href=&quot;https://schlomp.space/tastytea/whyblocked&quot;&gt;https://schlomp.space/tastytea/whyblocked&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;small&gt;Copyright © 2018 &lt;a href=&quot;mailto:tastytea@tastytea.de&quot;&gt;tastytea&lt;/a&gt;.&lt;br&gt;Lizenz GPLv3: &lt;a href=&quot;https://www.gnu.org/licenses/gpl-3.0.html&quot;&gt;GNU GPL version 3&lt;/a&gt;.&lt;br&gt;Für dieses Programm besteht KEINERLEI GARANTIE. Dies ist freie Software, die Sie unter bestimmten Bedingungen weitergeben dürfen.&lt;/small&gt;&lt;/p&gt;</translation>
</message> </message>
<message> <message>
<location filename="../src/qt/mainwindow.cpp" line="310"/> <location filename="../src/qt/mainwindow.cpp" line="312"/>
<source>Receipts:</source> <source>Receipts:</source>
<translation>Belege:</translation> <translation>Belege:</translation>
</message> </message>

View File

@ -198,7 +198,7 @@
</message> </message>
<message> <message>
<location filename="../src/qt/whyblocked.ui" line="285"/> <location filename="../src/qt/whyblocked.ui" line="285"/>
<location filename="../src/qt/mainwindow.cpp" line="275"/> <location filename="../src/qt/mainwindow.cpp" line="277"/>
<source>Edit entry</source> <source>Edit entry</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
@ -219,18 +219,18 @@
</message> </message>
<message> <message>
<location filename="../src/qt/whyblocked.ui" line="59"/> <location filename="../src/qt/whyblocked.ui" line="59"/>
<location filename="../src/qt/mainwindow.cpp" line="325"/> <location filename="../src/qt/mainwindow.cpp" line="327"/>
<source>User/Instance</source> <source>User/Instance</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../src/qt/mainwindow.cpp" line="326"/> <location filename="../src/qt/mainwindow.cpp" line="328"/>
<source>Blocked/Silenced</source> <source>Blocked/Silenced</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../src/qt/whyblocked.ui" line="72"/> <location filename="../src/qt/whyblocked.ui" line="72"/>
<location filename="../src/qt/mainwindow.cpp" line="327"/> <location filename="../src/qt/mainwindow.cpp" line="329"/>
<source>Reason</source> <source>Reason</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
@ -250,37 +250,37 @@
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../src/qt/mainwindow.cpp" line="269"/> <location filename="../src/qt/mainwindow.cpp" line="271"/>
<source>Invalid selection</source> <source>Invalid selection</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../src/qt/mainwindow.cpp" line="270"/> <location filename="../src/qt/mainwindow.cpp" line="272"/>
<source>Please select only 1 entry to edit.</source> <source>Please select only 1 entry to edit.</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../src/qt/mainwindow.cpp" line="209"/> <location filename="../src/qt/mainwindow.cpp" line="211"/>
<source>Nothing selected</source> <source>Nothing selected</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../src/qt/mainwindow.cpp" line="210"/> <location filename="../src/qt/mainwindow.cpp" line="212"/>
<source>Please select entries to remove.</source> <source>Please select entries to remove.</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../src/qt/mainwindow.cpp" line="288"/> <location filename="../src/qt/mainwindow.cpp" line="290"/>
<source>About Whyblocked</source> <source>About Whyblocked</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../src/qt/mainwindow.cpp" line="289"/> <location filename="../src/qt/mainwindow.cpp" line="291"/>
<source>&lt;p&gt;&lt;b&gt;Whyblocked&lt;/b&gt; %1&lt;/p&gt;&lt;p&gt;Reminds you why you blocked someone.&lt;/p&gt;&lt;p&gt;Sourcecode: &lt;a href=&quot;https://schlomp.space/tastytea/whyblocked&quot;&gt;https://schlomp.space/tastytea/whyblocked&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;small&gt;Copyright © 2018 &lt;a href=&quot;mailto:tastytea@tastytea.de&quot;&gt;tastytea&lt;/a&gt;.&lt;br&gt;Licence GPLv3: &lt;a href=&quot;https://www.gnu.org/licenses/gpl-3.0.html&quot;&gt;GNU GPL version 3&lt;/a&gt;.&lt;br&gt;This program comes with ABSOLUTELY NO WARRANTY. This is free software, and you are welcome to redistribute it under certain conditions.&lt;/small&gt;&lt;/p&gt;</source> <source>&lt;p&gt;&lt;b&gt;Whyblocked&lt;/b&gt; %1&lt;/p&gt;&lt;p&gt;Reminds you why you blocked someone.&lt;/p&gt;&lt;p&gt;Sourcecode: &lt;a href=&quot;https://schlomp.space/tastytea/whyblocked&quot;&gt;https://schlomp.space/tastytea/whyblocked&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;small&gt;Copyright © 2018 &lt;a href=&quot;mailto:tastytea@tastytea.de&quot;&gt;tastytea&lt;/a&gt;.&lt;br&gt;Licence GPLv3: &lt;a href=&quot;https://www.gnu.org/licenses/gpl-3.0.html&quot;&gt;GNU GPL version 3&lt;/a&gt;.&lt;br&gt;This program comes with ABSOLUTELY NO WARRANTY. This is free software, and you are welcome to redistribute it under certain conditions.&lt;/small&gt;&lt;/p&gt;</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../src/qt/mainwindow.cpp" line="310"/> <location filename="../src/qt/mainwindow.cpp" line="312"/>
<source>Receipts:</source> <source>Receipts:</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>