Delete all selected rows, not just half.
the build was successful Details

This commit is contained in:
tastytea 2019-01-15 01:37:55 +01:00
parent 229c3f6645
commit 59466c5f9e
Signed by: tastytea
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)
project (whyblocked
VERSION 0.14.4
VERSION 0.14.5
LANGUAGES CXX
)

View File

@ -196,8 +196,11 @@ void MainWindow::remove()
QItemSelectionModel *selection = tableview->selectionModel();
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();
_database.remove(user);
_model->removeRow(row.row());

View File

@ -198,7 +198,7 @@
</message>
<message>
<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>
<translation>Eintrag bearbeiten</translation>
</message>
@ -219,18 +219,18 @@
</message>
<message>
<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>
<translation>Benutzer/Instanz</translation>
</message>
<message>
<location filename="../src/qt/mainwindow.cpp" line="326"/>
<location filename="../src/qt/mainwindow.cpp" line="328"/>
<source>Blocked/Silenced</source>
<translation>Blockiert/Gedämpft</translation>
</message>
<message>
<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>
<translation>Begründung</translation>
</message>
@ -250,37 +250,37 @@
<translation>gedämpft</translation>
</message>
<message>
<location filename="../src/qt/mainwindow.cpp" line="269"/>
<location filename="../src/qt/mainwindow.cpp" line="271"/>
<source>Invalid selection</source>
<translation>Ungültige Auswahl</translation>
</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>
<translation>Bitte nur 1 Eintrag zum bearbeiten auswählen.</translation>
</message>
<message>
<location filename="../src/qt/mainwindow.cpp" line="209"/>
<location filename="../src/qt/mainwindow.cpp" line="211"/>
<source>Nothing selected</source>
<translation>Nichts ausgewählt</translation>
</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>
<translation>Bitte wähle Einträge aus, die gelöscht werden sollen.</translation>
</message>
<message>
<location filename="../src/qt/mainwindow.cpp" line="288"/>
<location filename="../src/qt/mainwindow.cpp" line="290"/>
<source>About Whyblocked</source>
<translation>Über Whyblocked</translation>
</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>
<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>
<location filename="../src/qt/mainwindow.cpp" line="310"/>
<location filename="../src/qt/mainwindow.cpp" line="312"/>
<source>Receipts:</source>
<translation>Belege:</translation>
</message>

View File

@ -198,7 +198,7 @@
</message>
<message>
<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>
<translation type="unfinished"></translation>
</message>
@ -219,18 +219,18 @@
</message>
<message>
<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>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/qt/mainwindow.cpp" line="326"/>
<location filename="../src/qt/mainwindow.cpp" line="328"/>
<source>Blocked/Silenced</source>
<translation type="unfinished"></translation>
</message>
<message>
<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>
<translation type="unfinished"></translation>
</message>
@ -250,37 +250,37 @@
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/qt/mainwindow.cpp" line="269"/>
<location filename="../src/qt/mainwindow.cpp" line="271"/>
<source>Invalid selection</source>
<translation type="unfinished"></translation>
</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>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/qt/mainwindow.cpp" line="209"/>
<location filename="../src/qt/mainwindow.cpp" line="211"/>
<source>Nothing selected</source>
<translation type="unfinished"></translation>
</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>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/qt/mainwindow.cpp" line="288"/>
<location filename="../src/qt/mainwindow.cpp" line="290"/>
<source>About Whyblocked</source>
<translation type="unfinished"></translation>
</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>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/qt/mainwindow.cpp" line="310"/>
<location filename="../src/qt/mainwindow.cpp" line="312"/>
<source>Receipts:</source>
<translation type="unfinished"></translation>
</message>