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

List:       kde-commits
Subject:    KDE/kdevplatform/shell
From:       Andreas Pakulat <apaku () gmx ! de>
Date:       2009-11-08 15:42:55
Message-ID: 1257694975.620210.20429.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 1046383 by apaku:

For new users its better if Build&Co automatically work.

Add opened projects to the buildset (if no item from the
project is in it yet).

 M  +24 -0     projectcontroller.cpp  
 M  +5 -0      settings/projectconfig.kcfg  
 M  +17 -2     settings/projectsettings.ui  


--- trunk/KDE/kdevplatform/shell/projectcontroller.cpp #1046382:1046383
@@ -82,6 +82,12 @@
     return group.readEntry( "Reopen Projects On Startup", true );
 }
 
+bool addProjectsToBuildset()
+{
+    KConfigGroup group = Core::self()->activeSession()->config()->group( "Project \
Manager" ); +    return group.readEntry( "Automatically Add Projects to Buildset", \
true ); +}
+
 bool parseAllProjectSources()
 {
     KConfigGroup group = Core::self()->activeSession()->config()->group( "Project \
Manager" ); @@ -623,6 +629,24 @@
     d->m_currentlyOpening.removeAll(project->projectFileUrl());
     emit projectOpened( project );
 
+    if( addProjectsToBuildset() )
+    {
+        // Add project to buildset, but only if there is no item for that
+        // project yet.
+        bool found = false;
+        foreach( BuildItem bi, d->buildset->items() )
+        {
+            if( bi.itemProject() == project->name() )
+            {
+                found = true;
+            }
+        }
+        if( !found )
+        {
+            d->buildset->addProjectItem( project->projectItem() );
+        }
+    }
+    
     if (parseAllProjectSources())
     {
         KJob* parseProjectJob = new KDevelop::ParseProjectJob(project);
--- trunk/KDE/kdevplatform/shell/settings/projectconfig.kcfg #1046382:1046383
@@ -28,5 +28,10 @@
         <label>Save all open documents before building anything</label>
         <whatsthis>If this option is set all open documents will be automatically \
saved before any build is started.</whatsthis>  </entry>
+    <entry name="autoAddProjectsToBuildset" key="Automatically Add Projects to \
Buildset" type="Bool" default="true"> +        <default>true</default>
+        <label>Automatically add opened projects to the Buildset</label>
+        <whatsthis>If this option is enabled then any project that is opened will \
automatically be added to the buildset.</whatsthis> +    </entry>
   </group>
 </kcfg>
--- trunk/KDE/kdevplatform/shell/settings/projectsettings.ui #1046382:1046383
@@ -6,7 +6,7 @@
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>586</width>
+    <width>597</width>
     <height>247</height>
    </rect>
   </property>
@@ -69,7 +69,7 @@
      </property>
     </widget>
    </item>
-   <item row="4" column="1">
+   <item row="5" column="1">
     <spacer name="verticalSpacer">
      <property name="orientation">
       <enum>Qt::Vertical</enum>
@@ -97,6 +97,21 @@
      </property>
     </widget>
    </item>
+   <item row="4" column="0">
+    <widget class="QLabel" name="label_5">
+     <property name="text">
+      <string>Automatically Add Opened
+Projects to the Buildset</string>
+     </property>
+    </widget>
+   </item>
+   <item row="4" column="1">
+    <widget class="QCheckBox" name="kcfg_autoAddProjectsToBuildset">
+     <property name="text">
+      <string/>
+     </property>
+    </widget>
+   </item>
   </layout>
  </widget>
  <customwidgets>


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

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