summaryrefslogtreecommitdiffstats
path: root/src/sq_codecsettings.cpp
diff options
context:
space:
mode:
authorMichele Calgaro <michele.calgaro@yahoo.it>2025-02-10 15:10:13 +0900
committerMichele Calgaro <michele.calgaro@yahoo.it>2025-02-13 11:44:42 +0900
commit8f8f84410cc591c85c5e83e0b3efdcda5fdbe42e (patch)
treef273a932ce048ef22ea9d9888b77ea8a2b8f3e33 /src/sq_codecsettings.cpp
parent424635023ee423826de12514b2fec7834b8deb7b (diff)
downloadksquirrel-8f8f8441.tar.gz
ksquirrel-8f8f8441.zip
Rename 'ksquirrel' folder to 'src'
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it> (cherry picked from commit 203fcb8d90752b546c672c625927a136b959fcfb)
Diffstat (limited to 'src/sq_codecsettings.cpp')
-rw-r--r--src/sq_codecsettings.cpp42
1 files changed, 42 insertions, 0 deletions
diff --git a/src/sq_codecsettings.cpp b/src/sq_codecsettings.cpp
new file mode 100644
index 0000000..47b3609
--- /dev/null
+++ b/src/sq_codecsettings.cpp
@@ -0,0 +1,42 @@
+/***************************************************************************
+ sq_codecsettings.cpp - description
+ -------------------
+ begin : Mon Mar 5 2007
+ copyright : (C) 2007 by Baryshev Dmitry
+ email : ksquirrel.iv@gmail.com
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#include <ksquirrel-libs/fmt_codec_base.h>
+
+#include "sq_codecsettings.h"
+#include "sq_library.h"
+#include "sq_config.h"
+
+void SQ_CodecSettings::applySettings(SQ_LIBRARY *lib, SQ_CodecSettings::settings fromwhere)
+{
+ SQ_Config::instance()->setGroup("Main");
+
+ int set = SQ_Config::instance()->readNumEntry("applyto", SQ_CodecSettings::Both);
+
+ // thumbnail loader and image viewer will use default settings
+ if((fromwhere == SQ_CodecSettings::ThumbnailLoader && (set == SQ_CodecSettings::ThumbnailLoader || set == SQ_CodecSettings::Both))
+ || (fromwhere == SQ_CodecSettings::ImageViewer && (set == SQ_CodecSettings::ImageViewer || set == SQ_CodecSettings::Both)))
+ {
+ lib->codec->set_settings(lib->settings);
+ lib->codec_il->set_settings(lib->settings);
+ }
+ else
+ {
+ lib->codec->fill_default_settings();
+ lib->codec_il->fill_default_settings();
+ }
+}