[rkward] rkward: Small cleanup

Thomas Friedrichsmeier thomas.friedrichsmeier at ruhr-uni-bochum.de
Wed Feb 10 09:49:20 UTC 2016


Git commit e298169f6ed2d27ecca9d9a8781b713bb1ab5375 by Thomas Friedrichsmeier.
Committed on 10/02/2016 at 08:02.
Pushed by tfry into branch 'master'.

Small cleanup

M  +2    -4    rkward/plugin/rkstandardcomponentgui.cpp
M  +3    -3    rkward/settings/rksettingsmoduleplugins.cpp
M  +3    -3    rkward/settings/rksettingsmoduleplugins.h

http://commits.kde.org/rkward/e298169f6ed2d27ecca9d9a8781b713bb1ab5375

diff --git a/rkward/plugin/rkstandardcomponentgui.cpp b/rkward/plugin/rkstandardcomponentgui.cpp
index a32199d..1c53085 100644
--- a/rkward/plugin/rkstandardcomponentgui.cpp
+++ b/rkward/plugin/rkstandardcomponentgui.cpp
@@ -112,15 +112,13 @@ public:
 
 	void saveSize () {
 		if (extension->isVisible ()) {
-#warning clean up!
-			if (orientation () == Qt::Horizontal) RKSettingsModulePlugins::setDefaultOtherPreviewHeight (sizes ()[1]);
+			if (orientation () == Qt::Horizontal) RKSettingsModulePlugins::setDefaultSidePreviewWidth (sizes ()[1]);
 			else RKSettingsModulePlugins::setDefaultCodeHeight (sizes ()[1]);
 		}
 	}
 
 	int defaultExtensionSize () {
-#warning clean up!
-		return ((orientation () == Qt::Horizontal) ? RKSettingsModulePlugins::defaultOtherPreviewHeight() : RKSettingsModulePlugins::defaultCodeHeight ());
+		return ((orientation () == Qt::Horizontal) ? RKSettingsModulePlugins::defaultSidePreviewWidth () : RKSettingsModulePlugins::defaultCodeHeight ());
 	}
 
 	bool isExtensionVisible () const { return extension->isVisible (); };
diff --git a/rkward/settings/rksettingsmoduleplugins.cpp b/rkward/settings/rksettingsmoduleplugins.cpp
index ca3a98c..5eba3a6 100644
--- a/rkward/settings/rksettingsmoduleplugins.cpp
+++ b/rkward/settings/rksettingsmoduleplugins.cpp
@@ -49,7 +49,7 @@ QList<RKSettingsModulePlugins::PluginMapStoredInfo> RKSettingsModulePlugins::kno
 RKSettingsModulePlugins::PluginPrefs RKSettingsModulePlugins::interface_pref;
 bool RKSettingsModulePlugins::show_code;
 int RKSettingsModulePlugins::code_size;
-int RKSettingsModulePlugins::other_preview_height;
+int RKSettingsModulePlugins::side_preview_width;
 
 RKSettingsModulePlugins::RKSettingsModulePlugins (RKSettings *gui, QWidget *parent) : RKSettingsModule (gui, parent) {
 	RK_TRACE (SETTINGS);
@@ -155,7 +155,7 @@ void RKSettingsModulePlugins::saveSettings (KConfig *config) {
 	cg.writeEntry ("Interface Preferences", static_cast<int> (interface_pref));
 	cg.writeEntry ("Code display default", show_code);
 	cg.writeEntry ("Code display size", code_size);
-	cg.writeEntry ("Other preview size", other_preview_height);
+	cg.writeEntry ("Other preview size", side_preview_width);
 }
 
 void RKSettingsModulePlugins::loadSettings (KConfig *config) {
@@ -201,7 +201,7 @@ void RKSettingsModulePlugins::loadSettings (KConfig *config) {
 	interface_pref = static_cast<PluginPrefs> (cg.readEntry ("Interface Preferences", static_cast<int> (PreferRecommended)));
 	show_code = cg.readEntry ("Code display default", false);
 	code_size = cg.readEntry ("Code display size", 250);
-	other_preview_height = cg.readEntry ("Other preview size", code_size);
+	side_preview_width = cg.readEntry ("Other preview size", 250);
 
 	if (RKSettingsModuleGeneral::storedConfigVersion () <= RKSettingsModuleGeneral::RKWardConfig_Pre0_5_7) {
 		if (code_size == 40) code_size = 250;	// previous default untouched.
diff --git a/rkward/settings/rksettingsmoduleplugins.h b/rkward/settings/rksettingsmoduleplugins.h
index 5ef950e..811c515 100644
--- a/rkward/settings/rksettingsmoduleplugins.h
+++ b/rkward/settings/rksettingsmoduleplugins.h
@@ -56,8 +56,8 @@ public:
 	static void setShowCodeByDefault (bool shown) { show_code = shown; };
 	static int defaultCodeHeight () { return code_size; };
 	static void setDefaultCodeHeight (int new_height) { code_size = new_height; }
-	static int defaultOtherPreviewHeight () { return other_preview_height; };
-	static void setDefaultOtherPreviewHeight (int new_height) { other_preview_height = new_height; }
+	static int defaultSidePreviewWidth () { return side_preview_width; };
+	static void setDefaultSidePreviewWidth (int new_width) { side_preview_width = new_width; }
 	/** register a list of available plugin-maps (which may or may not already be known). New maps are activated, automatically.
 	 * @param maps Plugin maps (filenames) to add
 	 * @param force_add If true, maps are added, even if they are not "new", and had previously been disabled by the user
@@ -101,7 +101,7 @@ private:
 	static PluginPrefs interface_pref;
 	static bool show_code;
 	static int code_size;
-	static int other_preview_height;
+	static int side_preview_width;
 
 /* TODO: This one is currently unused (leftover of GHNS-based plugin installation), but might still be of interest */
 	static QStringList findPluginMapsRecursive (const QString &basedir);



More information about the rkward-tracker mailing list