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

List:       kde-commits
Subject:    extragear/sysadmin/kiosktool
From:       Luboš Luňák <l.lunak () kde ! org>
Date:       2010-03-11 17:13:36
Message-ID: 1268327616.228602.8548.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 1102042 by lunakl:

int -> enum



 M  +9 -9      kioskgui.cpp  
 M  +6 -6      kioskgui.h  


--- trunk/extragear/sysadmin/kiosktool/kioskgui.cpp #1102041:1102042
@@ -70,7 +70,7 @@
     : KXmlGuiWindow(), m_profileSelectionPage(0),
     m_componentSelectionPage(0), m_componentPage(0), m_profileAssignPage(0),
     m_profilePropsPage(0), m_data(0),
-    m_profile(0), m_componentData(0),m_page(-1)
+    m_profile(0), m_componentData(0),m_page(PAGE_PROFILE_SELECTION)
 {
     m_run = new KioskRun(this);
     m_view = new MainView(this);
@@ -228,16 +228,16 @@
 }
 
 
-void KioskGui::selectPage(int page)
+void KioskGui::selectPage(Page page)
 {
-    if( m_page ==  PAGE_COMPONENT_SELECTION)
+    if( m_page ==  PAGE_COMPONENT_SELECTION )
     {
         m_component = m_componentSelectionPage->currentComponent();
         m_componentData = m_data->m_componentData[m_component];
         if (!m_componentData)
            return;
     }
-    if( m_page ==  PAGE_PROFILE_SELECTION )
+    if( m_page ==  PAGE_PROFILE_SELECTION && m_profileSelectionPage )
     {
         m_profile = m_profileSelectionPage->listProfile->currentItem() ?
                     m_profileSelectionPage->listProfile->currentItem()->text(0) : \
QString(); @@ -458,7 +458,7 @@
       m_profileSelectionPage->listProfile->setCurrentItem(m_profileSelectionPage->listProfile->topLevelItem(0));
  }
 
-void KioskGui::loadPage(int page)
+void KioskGui::loadPage(Page page)
 {
       if( page == PAGE_PROFILE_SELECTION )
       {
@@ -482,7 +482,7 @@
       }
 }
 
-bool KioskGui::savePage(int page)
+bool KioskGui::savePage(Page page)
 {
       if( page ==  PAGE_COMPONENT_SELECTION)
       {
@@ -532,10 +532,10 @@
     {
         if( !save )
 	    m_componentSelectionPage->discard();
-	selectPage(m_page - 1);
+	selectPage(PAGE_PROFILE_SELECTION);
     }
-    else if (m_page > 1)
-       selectPage(m_page - 1);
+    else if (m_page == PAGE_COMPONENT)
+       selectPage(PAGE_COMPONENT_SELECTION);
 }
 
 void KioskGui::discardPage()
--- trunk/extragear/sysadmin/kiosktool/kioskgui.h #1102041:1102042
@@ -59,7 +59,7 @@
 {
    Q_OBJECT
 public:
-   enum { PAGE_PROFILE_SELECTION = 1,
+   enum Page { PAGE_PROFILE_SELECTION = 1,
           PAGE_COMPONENT_SELECTION = 2,
           PAGE_COMPONENT = 3,
           PAGE_PROFILE_NEW = 4,
@@ -74,9 +74,9 @@
    void saveProperties(KConfigGroup &config);
    void readProperties(const KConfigGroup &config);
 
-   void selectPage(int page);
-   void loadPage(int page);
-   bool savePage(int page);
+   void selectPage(Page page);
+   void loadPage(Page page);
+   bool savePage(Page page);
 
    void loadProfiles();
 
@@ -121,8 +121,8 @@
    ComponentData * m_componentData;
    KAction *m_uploadAction;
    KToggleAction *m_backgroundAction;
-   QMap<int,int> m_pageMapping;
-   int m_page;
+   QMap<Page,int> m_pageMapping;
+   Page m_page;
 };
 
 #endif


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

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