[Cmake-commits] CMake branch, next, updated. v2.8.6-1961-gb973dab

Alexander Neundorf neundorf at kde.org
Sat Nov 19 16:25:32 EST 2011


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".

The branch, next has been updated
       via  b973dab101c577752f0f247f22dc265e839d7bd0 (commit)
       via  b0d01c306bd8dc6c636e65d38dc0d9e483568a67 (commit)
       via  08c59af4dec0628964d9534ac165d75914bf580c (commit)
       via  fa878d27bf3585e9ea2bc07ceb150268a114944a (commit)
      from  bca5aa95663745afae25c0d9bfe7a69970fe56ee (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=b973dab101c577752f0f247f22dc265e839d7bd0
commit b973dab101c577752f0f247f22dc265e839d7bd0
Merge: bca5aa9 b0d01c3
Author:     Alexander Neundorf <neundorf at kde.org>
AuthorDate: Sat Nov 19 16:25:31 2011 -0500
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Sat Nov 19 16:25:31 2011 -0500

    Merge topic 'cmake-gui_AddCompletionForAddCacheEntry' into next
    
    b0d01c3 cmake-gui: add completion for the names when adding cache entries
    08c59af Remove trailing whitespace
    fa878d2 KWSys Nightly Date Stamp


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=b0d01c306bd8dc6c636e65d38dc0d9e483568a67
commit b0d01c306bd8dc6c636e65d38dc0d9e483568a67
Author:     Alex Neundorf <neundorf at kde.org>
AuthorDate: Sat Nov 19 22:21:41 2011 +0100
Commit:     Alex Neundorf <neundorf at kde.org>
CommitDate: Sat Nov 19 22:21:41 2011 +0100

    cmake-gui: add completion for the names when adding cache entries
    
    Up to 100 completion strings for the names of added variables
    are saved in the settings, so it will remember the variables
    you are usually adding.
    It also ensures that CMAKE_INSTALL_PREFIX is always there, since
    this is maybe the one which is set most often.
    
    Alex

diff --git a/Source/QtDialog/AddCacheEntry.cxx b/Source/QtDialog/AddCacheEntry.cxx
index 412d443..00aaf69 100644
--- a/Source/QtDialog/AddCacheEntry.cxx
+++ b/Source/QtDialog/AddCacheEntry.cxx
@@ -12,6 +12,7 @@
 
 #include "AddCacheEntry.h"
 #include <QMetaProperty>
+#include <QCompleter>
 
 static const int NumTypes = 4;
 static const QString TypeStrings[NumTypes] =
@@ -20,7 +21,7 @@ static const QCMakeProperty::PropertyType Types[NumTypes] =
   { QCMakeProperty::BOOL, QCMakeProperty::PATH,
     QCMakeProperty::FILEPATH, QCMakeProperty::STRING};
 
-AddCacheEntry::AddCacheEntry(QWidget* p)
+AddCacheEntry::AddCacheEntry(QWidget* p, const QStringList& completions)
   : QWidget(p)
 {
   this->setupUi(this);
@@ -42,6 +43,7 @@ AddCacheEntry::AddCacheEntry(QWidget* p)
   this->setTabOrder(path, filepath);
   this->setTabOrder(filepath, string);
   this->setTabOrder(string, this->Description);
+  this->Name->setCompleter(new QCompleter(completions, this));
 }
 
 QString AddCacheEntry::name() const
diff --git a/Source/QtDialog/AddCacheEntry.h b/Source/QtDialog/AddCacheEntry.h
index db6baf9..e219d4e 100644
--- a/Source/QtDialog/AddCacheEntry.h
+++ b/Source/QtDialog/AddCacheEntry.h
@@ -15,6 +15,7 @@
 
 #include <QWidget>
 #include <QCheckBox>
+#include <QStringList>
 
 #include "QCMake.h"
 #include "ui_AddCacheEntry.h"
@@ -23,7 +24,7 @@ class AddCacheEntry : public QWidget, public Ui::AddCacheEntry
 {
   Q_OBJECT
 public:
-  AddCacheEntry(QWidget* p);
+  AddCacheEntry(QWidget* p, const QStringList& completions);
 
   QString name() const;
   QVariant value() const;
diff --git a/Source/QtDialog/CMakeSetupDialog.cxx b/Source/QtDialog/CMakeSetupDialog.cxx
index c8c4bfa..1c058d3 100644
--- a/Source/QtDialog/CMakeSetupDialog.cxx
+++ b/Source/QtDialog/CMakeSetupDialog.cxx
@@ -68,6 +68,9 @@ CMakeSetupDialog::CMakeSetupDialog()
   int w = settings.value("Width", 700).toInt();
   this->resize(w, h);
 
+  this->AddVariableCompletions = settings.value("AddVariableCompletionEntries",
+                           QStringList("CMAKE_INSTALL_PREFIX")).toStringList();
+
   QWidget* cont = new QWidget(this);
   this->setupUi(cont);
   this->Splitter->setStretchFactor(0, 3);
@@ -1008,7 +1011,7 @@ void CMakeSetupDialog::addCacheEntry()
   dialog.resize(400, 200);
   dialog.setWindowTitle(tr("Add Cache Entry"));
   QVBoxLayout* l = new QVBoxLayout(&dialog);
-  AddCacheEntry* w = new AddCacheEntry(&dialog);
+  AddCacheEntry* w = new AddCacheEntry(&dialog, this->AddVariableCompletions);
   QDialogButtonBox* btns = new QDialogButtonBox(
       QDialogButtonBox::Ok | QDialogButtonBox::Cancel,
       Qt::Horizontal, &dialog);
@@ -1021,6 +1024,26 @@ void CMakeSetupDialog::addCacheEntry()
     {
     QCMakeCacheModel* m = this->CacheValues->cacheModel();
     m->insertProperty(w->type(), w->name(), w->description(), w->value(), false);
+
+    // only add variable names to the completion which are new
+    if (!this->AddVariableCompletions.contains(w->name()))
+      {
+      this->AddVariableCompletions << w->name();
+      // limit to at most 100 completion items
+      if (this->AddVariableCompletions.size() > 100)
+        {
+        this->AddVariableCompletions.removeFirst();
+        }
+      // make sure CMAKE_INSTALL_PREFIX is always there
+      if (!this->AddVariableCompletions.contains("CMAKE_INSTALL_PREFIX"))
+        {
+        this->AddVariableCompletions << QString("CMAKE_INSTALL_PREFIX");
+        }
+      QSettings settings;
+      settings.beginGroup("Settings/StartPath");
+      settings.setValue("AddVariableCompletionEntries",
+                        this->AddVariableCompletions);
+      }
     }
 }
 
diff --git a/Source/QtDialog/CMakeSetupDialog.h b/Source/QtDialog/CMakeSetupDialog.h
index b905077..2599675 100644
--- a/Source/QtDialog/CMakeSetupDialog.h
+++ b/Source/QtDialog/CMakeSetupDialog.h
@@ -105,6 +105,8 @@ protected:
   QTextCharFormat ErrorFormat;
   QTextCharFormat MessageFormat;
 
+  QStringList AddVariableCompletions;
+
   QEventLoop LocalLoop;
 
   float ProgressOffset;

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=08c59af4dec0628964d9534ac165d75914bf580c
commit 08c59af4dec0628964d9534ac165d75914bf580c
Author:     Alex Neundorf <neundorf at kde.org>
AuthorDate: Sat Nov 19 22:19:48 2011 +0100
Commit:     Alex Neundorf <neundorf at kde.org>
CommitDate: Sat Nov 19 22:19:48 2011 +0100

    Remove trailing whitespace
    
    Alex

diff --git a/Source/QtDialog/AddCacheEntry.cxx b/Source/QtDialog/AddCacheEntry.cxx
index b4d9191..412d443 100644
--- a/Source/QtDialog/AddCacheEntry.cxx
+++ b/Source/QtDialog/AddCacheEntry.cxx
@@ -14,11 +14,11 @@
 #include <QMetaProperty>
 
 static const int NumTypes = 4;
-static const QString TypeStrings[NumTypes] = 
+static const QString TypeStrings[NumTypes] =
   { "BOOL", "PATH", "FILEPATH", "STRING" };
-static const QCMakeProperty::PropertyType Types[NumTypes] = 
-  { QCMakeProperty::BOOL, QCMakeProperty::PATH, 
-    QCMakeProperty::FILEPATH, QCMakeProperty::STRING}; 
+static const QCMakeProperty::PropertyType Types[NumTypes] =
+  { QCMakeProperty::BOOL, QCMakeProperty::PATH,
+    QCMakeProperty::FILEPATH, QCMakeProperty::STRING};
 
 AddCacheEntry::AddCacheEntry(QWidget* p)
   : QWidget(p)
diff --git a/Source/QtDialog/CMakeSetupDialog.h b/Source/QtDialog/CMakeSetupDialog.h
index 5121759..b905077 100644
--- a/Source/QtDialog/CMakeSetupDialog.h
+++ b/Source/QtDialog/CMakeSetupDialog.h
@@ -36,7 +36,7 @@ public slots:
   void setBinaryDirectory(const QString& dir);
   void setSourceDirectory(const QString& dir);
 
-protected slots: 
+protected slots:
   void initialize();
   void doConfigure();
   void doGenerate();
@@ -46,7 +46,7 @@ protected slots:
   void doInterrupt();
   void error(const QString& message);
   void message(const QString& message);
-  
+
   void doSourceBrowse();
   void doBinaryBrowse();
   void doReloadCache();
@@ -118,8 +118,8 @@ class QCMakeThread : public QThread
 public:
   QCMakeThread(QObject* p);
   QCMake* cmakeInstance() const;
-  
-signals:  
+
+signals:
   void cmakeInitialized();
 
 protected:

-----------------------------------------------------------------------

Summary of changes:
 Source/QtDialog/AddCacheEntry.cxx    |   12 +++++++-----
 Source/QtDialog/AddCacheEntry.h      |    3 ++-
 Source/QtDialog/CMakeSetupDialog.cxx |   25 ++++++++++++++++++++++++-
 Source/QtDialog/CMakeSetupDialog.h   |   10 ++++++----
 Source/kwsys/kwsysDateStamp.cmake    |    2 +-
 5 files changed, 40 insertions(+), 12 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list