[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    kdevelop/parts/appwizard
From:       Alexander Dymo <cloudtemple () mksat ! net>
Date:       2005-01-12 23:20:54
Message-ID: 20050112232054.A0ECB1BC59 () office ! kde ! org
[Download RAW message or body]

CVS commit by dymo: 

Finally fixed application template filtering which is based on the current profile. \
Also made "Show all templates" setting off by default. This does not affect \
"kdevelop" application because it starts with the "IDE" profile (includes all \
application templates). Only "kdevelop --profile ..." invokes filtering.


  M +1 -1      Makefile.am   1.56
  M +34 -1     appwizarddlg.cpp   1.113
  M +4 -0      appwizarddlg.h   1.35
  M +1 -1      appwizarddlgbase.ui   1.22


--- kdevelop/parts/appwizard/appwizarddlgbase.ui  #1.21:1.22
@@ -95,5 +95,5 @@
                             </property>
                             <property name="checked">
-                                <bool>true</bool>
+                                <bool>false</bool>
                             </property>
                         </widget>

--- kdevelop/parts/appwizard/appwizarddlg.cpp  #1.112:1.113
@@ -311,5 +311,5 @@ AppWizardDialog::AppWizardDialog(AppWiza
         m_custom_options_layout->setAutoAdd(true);
         
-        showTemplates(true);
+        showTemplates(false);
 }
 
@@ -913,4 +913,5 @@ void AppWizardDialog::insertCategoryInto
             kdDebug(9010) << "Category: " << category << endl;
             m_categoryMap.insert(category,pParentItem);
+            m_categoryItems.append(pParentItem);
         } else {
             pParentItem = item;
@@ -1262,7 +1263,39 @@ void AppWizardDialog::showTemplates(bool
                         dit.current()->setVisible(visible);
                 }
+                checkAndHideItems(templates_listview);
+        }
+}
+
+void AppWizardDialog::checkAndHideItems(QListView *view)
+{
+        QListViewItem *item = view->firstChild();
+        while (item)
+        {
+                if (!m_categoryItems.contains(item))
+                        continue;
+                checkAndHideItems(item);
+                item = item->nextSibling();
         }
 }
 
+bool AppWizardDialog::checkAndHideItems(QListViewItem *item)
+{
+        if (!m_categoryItems.contains(item))
+                return !item->isVisible();
+        QListViewItem *child = item->firstChild();
+        bool hide = true;
+        while (child)
+        {
+                hide = hide && checkAndHideItems(child);
+                child = child->nextSibling();
+        }
+        kdDebug(9010) << "check_: " << item->text(0) << " hide: " <<  hide << endl;
+        if (hide)
+        {
+                item->setVisible(false);
+                return true;
+        }
+        return false;
+}
 
 #include "appwizarddlg.moc"

--- kdevelop/parts/appwizard/appwizarddlg.h  #1.34:1.35
@@ -163,4 +163,7 @@ private: //methods
         void setPermissions(const installFile &file);
         
+        void checkAndHideItems(QListView *view);
+        bool checkAndHideItems(QListViewItem *item);
+        
 private: //data
 
@@ -169,4 +172,5 @@ private: //data
     //! Store the category name and the pointer in the treeview
     QDict<QListViewItem> m_categoryMap;
+        QValueList<QListViewItem*> m_categoryItems;
     //! A list of currently available version control systems
 //    QDict<KDevVersionControl> m_availVcs;

--- kdevelop/parts/appwizard/Makefile.am  #1.55:1.56
@@ -10,5 +10,5 @@
 libkdevappwizard_la_LDFLAGS = $(all_libraries) $(KDE_PLUGIN)
 libkdevappwizard_la_LIBADD = $(top_builddir)/lib/libkdevelop.la \
-        $(top_builddir)/lib/interfaces/extras/libkdevextras.la
+        $(top_builddir)/lib/interfaces/extras/libkdevextras.la \
$(top_builddir)/lib/util/libkdevutil.la  
 libkdevappwizard_la_SOURCES = appwizardfactory.cpp appwizardpart.cpp \


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic