fixed filtering of files in channels

This commit is contained in:
csoler 2023-02-18 17:01:29 +01:00
parent f6c584183b
commit 5069a1a10e
3 changed files with 7 additions and 5 deletions

View File

@ -306,6 +306,10 @@ void GxsChannelFilesStatusWidget::resume()
void GxsChannelFilesStatusWidget::cancel()
{
// When QMessgeBox asks for cancel confirmtion, this makes the widget lose focus => since it is an editor widget,
// it gets destroyed by the parent list widget => subsequent code after the QMessageBox runs over a deleted object => crash
// In summary: no QMessageBox here when the Status widget is used as an editor.
if(!mUsedAsEditor)
if ((QMessageBox::question(this, "", tr("Are you sure that you want to cancel and delete the file?"), QMessageBox::Yes | QMessageBox::No, QMessageBox::No)) == QMessageBox::No) {
return;

View File

@ -295,7 +295,7 @@ void RsGxsChannelPostFilesModel::setFilter(const QStringList& strings, uint32_t&
{
preMods();
initEmptyHierarchy();
mFilteredFiles.clear();
if(strings.empty())
{
@ -317,8 +317,6 @@ void RsGxsChannelPostFilesModel::setFilter(const QStringList& strings, uint32_t&
}
count = mFilteredFiles.size();
std::cerr << "After filtering: " << count << " posts remain." << std::endl;
if (rowCount()>0)
{
beginInsertRows(QModelIndex(),0,rowCount()-1);

View File

@ -194,7 +194,7 @@
<item>
<widget class="QTabWidget" name="channel_TW">
<property name="currentIndex">
<number>1</number>
<number>2</number>
</property>
<widget class="QWidget" name="tab_3">
<attribute name="title">
@ -402,7 +402,7 @@
<string notr="true">&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Ubuntu'; font-size:11pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'MS Shell Dlg 2'; font-size:8pt;&quot;&gt;Description&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="textInteractionFlags">