+ kconfig-add-void-conf_set_changed_callbackvoid-fnvoid-use-it-in-qconfcc.patch added to -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled

     kconfig: add "void conf_set_changed_callback(void (*fn)(void))", use it in qconf.cc

has been added to the -mm tree.  Its filename is

     kconfig-add-void-conf_set_changed_callbackvoid-fnvoid-use-it-in-qconfcc.patch

See http://www.zip.com.au/~akpm/linux/patches/stuff/added-to-mm.txt to find
out what to do about this

------------------------------------------------------
Subject: kconfig: add "void conf_set_changed_callback(void (*fn)(void))", use it in qconf.cc
From: Karsten Wiese <annabellesgarden@xxxxxxxx>

Added function sets "void (*conf_changed_callback)(void)".  Call it, if
.config's changed state changes.  Use above in qconf.cc to set gui's
save-widget's sensitvity.

Signed-off-by: Karsten Wiese <fzu@xxxxxxxxxxxxxxxxxxxxx>
Cc: Sam Ravnborg <sam@xxxxxxxxxxxx>
Cc: Roman Zippel <zippel@xxxxxxxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxx>
---

 scripts/kconfig/confdata.c  |   12 +++++++++++-
 scripts/kconfig/lkc_proto.h |    1 +
 scripts/kconfig/qconf.cc    |   13 ++++++++++++-
 scripts/kconfig/qconf.h     |    3 +++
 4 files changed, 27 insertions(+), 2 deletions(-)

diff -puN scripts/kconfig/confdata.c~kconfig-add-void-conf_set_changed_callbackvoid-fnvoid-use-it-in-qconfcc scripts/kconfig/confdata.c
--- a/scripts/kconfig/confdata.c~kconfig-add-void-conf_set_changed_callbackvoid-fnvoid-use-it-in-qconfcc
+++ a/scripts/kconfig/confdata.c
@@ -767,18 +767,28 @@ int conf_write_autoconf(void)
 }
 
 static int sym_change_count;
+static void (*conf_changed_callback)(void);
 
 void sym_set_change_count(int count)
 {
+	int _sym_change_count = sym_change_count;
 	sym_change_count = count;
+	if (conf_changed_callback &&
+	    (bool)_sym_change_count != (bool)count)
+		conf_changed_callback();
 }
 
 void sym_add_change_count(int count)
 {
-	sym_change_count += count;
+	sym_set_change_count(count + sym_change_count);
 }
 
 bool conf_get_changed(void)
 {
 	return sym_change_count;
 }
+
+void conf_set_changed_callback(void (*fn)(void))
+{
+	conf_changed_callback = fn;
+}
diff -puN scripts/kconfig/lkc_proto.h~kconfig-add-void-conf_set_changed_callbackvoid-fnvoid-use-it-in-qconfcc scripts/kconfig/lkc_proto.h
--- a/scripts/kconfig/lkc_proto.h~kconfig-add-void-conf_set_changed_callbackvoid-fnvoid-use-it-in-qconfcc
+++ a/scripts/kconfig/lkc_proto.h
@@ -6,6 +6,7 @@ P(conf_read_simple,int,(const char *name
 P(conf_write,int,(const char *name));
 P(conf_write_autoconf,int,(void));
 P(conf_get_changed,bool,(void));
+P(conf_set_changed_callback, void,(void (*fn)(void)));
 
 /* menu.c */
 P(rootmenu,struct menu,);
diff -puN scripts/kconfig/qconf.cc~kconfig-add-void-conf_set_changed_callbackvoid-fnvoid-use-it-in-qconfcc scripts/kconfig/qconf.cc
--- a/scripts/kconfig/qconf.cc~kconfig-add-void-conf_set_changed_callbackvoid-fnvoid-use-it-in-qconfcc
+++ a/scripts/kconfig/qconf.cc
@@ -38,6 +38,8 @@
 static QApplication *configApp;
 static ConfigSettings *configSettings;
 
+QAction *ConfigMainWindow::saveAction;
+
 static inline QString qgettext(const char* str)
 {
 	return QString::fromLocal8Bit(gettext(str));
@@ -1305,8 +1307,11 @@ ConfigMainWindow::ConfigMainWindow(void)
 	  connect(quitAction, SIGNAL(activated()), SLOT(close()));
 	QAction *loadAction = new QAction("Load", QPixmap(xpm_load), "&Load", CTRL+Key_L, this);
 	  connect(loadAction, SIGNAL(activated()), SLOT(loadConfig()));
-	QAction *saveAction = new QAction("Save", QPixmap(xpm_save), "&Save", CTRL+Key_S, this);
+	saveAction = new QAction("Save", QPixmap(xpm_save), "&Save", CTRL+Key_S, this);
 	  connect(saveAction, SIGNAL(activated()), SLOT(saveConfig()));
+	conf_set_changed_callback(conf_changed);
+	// Set saveAction's initial state
+	conf_changed();
 	QAction *saveAsAction = new QAction("Save As...", "Save &As...", 0, this);
 	  connect(saveAsAction, SIGNAL(activated()), SLOT(saveConfigAs()));
 	QAction *searchAction = new QAction("Search", "&Search", CTRL+Key_F, this);
@@ -1657,6 +1662,12 @@ void ConfigMainWindow::saveSettings(void
 	configSettings->writeSizes("/split2", split2->sizes());
 }
 
+void ConfigMainWindow::conf_changed(void)
+{
+	if (saveAction)
+		saveAction->setEnabled(conf_get_changed());
+}
+
 void fixup_rootmenu(struct menu *menu)
 {
 	struct menu *child;
diff -puN scripts/kconfig/qconf.h~kconfig-add-void-conf_set_changed_callbackvoid-fnvoid-use-it-in-qconfcc scripts/kconfig/qconf.h
--- a/scripts/kconfig/qconf.h~kconfig-add-void-conf_set_changed_callbackvoid-fnvoid-use-it-in-qconfcc
+++ a/scripts/kconfig/qconf.h
@@ -297,6 +297,9 @@ protected:
 
 class ConfigMainWindow : public QMainWindow {
 	Q_OBJECT
+
+	static QAction *saveAction;
+	static void conf_changed(void);
 public:
 	ConfigMainWindow(void);
 public slots:
_

Patches currently in -mm which might be from annabellesgarden@xxxxxxxx are

kconfig-new-function-bool-conf_get_changedvoid.patch
kconfig-make-sym_change_count-static-let-it-be-altered-by-2-functions-only.patch
kconfig-add-void-conf_set_changed_callbackvoid-fnvoid-use-it-in-qconfcc.patch
kconfig-set-gconfs-save-widgets-sensitivity-according-to-configs-changed-state.patch
remove-quirk_via_abnormal_poweroff.patch

-
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Kernel Newbies FAQ]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Photo]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux