Added all the requested features. Patch attached. Is this ok to commit?

-- 
Shantanu Tushar    (GMT +0530)
http://www.shantanutushar.com

On Wed, Mar 11, 2009 at 3:38 AM, Aaron Seigo <ase...@kde.org> wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://reviewboard.kde.org/r/262/#review450
> -----------------------------------------------------------
>
>
> i think this addition is worth while; but i think we could also make the 
> labels clearer: "And Only Files of Type:" and all the mimetypes should be 
> selected by default.
>
> - Aaron
>
>
> On 2009-03-08 09:58:46, Shantanu Tushar Jha wrote:
>>
>> -----------------------------------------------------------
>> This is an automatically generated e-mail. To reply, visit:
>> http://reviewboard.kde.org/r/262/
>> -----------------------------------------------------------
>>
>> (Updated 2009-03-08 09:58:46)
>>
>>
>> Review request for Plasma.
>>
>>
>> Summary
>> -------
>>
>> This changes the UI for the configuration page "Filter" for the applet 
>> folderview. As seen in the bug 186283, files are only displayed if they 
>> match both the pattern and the MIME type. But there is no obvious indication 
>> to this behavior in the interface.
>> Added a label "Can't see files?" which has a tooltip explaining the above 
>> behavior. (screenshot attached)
>> Please review, and if found helpful, commit it, as I don't have a svn 
>> account.
>>
>>
>> This addresses bug 186283.
>>     https://bugs.kde.org/show_bug.cgi?id=186283
>>
>>
>> Diffs
>> -----
>>
>>   trunk/KDE/kdebase/apps/plasma/applets/folderview/folderviewFilterConfig.ui 
>> 936718
>>
>> Diff: http://reviewboard.kde.org/r/262/diff
>>
>>
>> Testing
>> -------
>>
>> On latest svn trunk build.
>>
>>
>> Screenshots
>> -----------
>>
>> Filter config page
>>   http://reviewboard.kde.org/r/262/s/52/
>>
>>
>> Thanks,
>>
>> Shantanu
>>
>>
>
>
Index: folderview.h
===================================================================
--- folderview.h	(revision 938285)
+++ folderview.h	(working copy)
@@ -164,6 +164,7 @@ private:
     QStringList m_previewPlugins;
     int m_customIconSize;
     int m_numTextLines;
+    int m_userSelectedShowAllFiles;
     QListView::Flow m_flow;
     QBasicTimer m_delayedSaveTimer;
 };
Index: folderview.cpp
===================================================================
--- folderview.cpp	(revision 938285)
+++ folderview.cpp	(working copy)
@@ -303,6 +303,7 @@ void FolderView::init()
     m_filterType          = cg.readEntry("filter", 0);
     m_filterFilesMimeList = cg.readEntry("mimeFilter", QStringList());
 
+    m_userSelectedShowAllFiles = m_filterType;
     m_flow = isContainment() ? QListView::TopToBottom : QListView::LeftToRight;
     m_flow = static_cast<QListView::Flow>(cg.readEntry("flow", static_cast<int>(m_flow)));
 
@@ -641,6 +642,7 @@ void FolderView::configAccepted()
         cg.writeEntry("url", m_url);
         cg.writeEntry("filterFiles", m_filterFiles);
         cg.writeEntry("filter", m_filterType);
+	m_userSelectedShowAllFiles = m_filterType;
         cg.writeEntry("mimeFilter", m_filterFilesMimeList);
 
         m_model->setMimeTypeFilterList(m_filterFilesMimeList);
@@ -1375,6 +1377,12 @@ void FolderView::filterChanged(int index
     uiFilter.filterFilesList->setEnabled(index != 0);
     uiFilter.selectAll->setEnabled(index != 0);
     uiFilter.deselectAll->setEnabled(index != 0);
+    if ((index != 0) && (m_userSelectedShowAllFiles == 0)) {
+      for (int i = 0; i < uiFilter.filterFilesList->model()->rowCount(); i++) {
+        const QModelIndex index = uiFilter.filterFilesList->model()->index(i, 0);
+        uiFilter.filterFilesList->model()->setData(index, Qt::Checked, Qt::CheckStateRole);
+      }
+    }
 }
 
 void FolderView::selectUnselectAll()
_______________________________________________
Plasma-devel mailing list
Plasma-devel@kde.org
https://mail.kde.org/mailman/listinfo/plasma-devel

Reply via email to