153 Commits

Author SHA1 Message Date
Filippos Karapetis 177f04349a COMMON: Use C++ 11 range-based for loops 2025-03-27 13:47:57 +08:00
Eugene Sandulenko 52b7b3194c COMMON: Return application-level value for ConfMan if exists. Bug #15262
This has been since forever. As it is mentioned in the config-manager.cpp,
we need to get rid of these methods. So far, they are used in GUI as supposed
and by usage, the devs were always relying on this behavior.

Thus, changing it should be safe as it seems, however, I plan to remove
these methods completely, so it stays clean without side effects.
2024-11-10 02:16:45 +01:00
kunxl-gg 6c2c8924d7 COMMON: Add ConfigManager::setFloat and ConfigManager::getFloat
Signed-off-by: kunxl-gg <tiwari.25@iitj.ac.in>
2024-08-25 23:17:20 +02:00
kunxl-gg 624d5a59b3 JANITORIAL: Get rid of redundant whitespaces
Signed-off-by: kunxl-gg <tiwari.25@iitj.ac.in>
2024-08-25 23:17:20 +02:00
Le Philousophe 01ebece807 COMMON: Make getDefaultConfigFileName return a Path instead of a String 2023-12-24 13:19:25 +01:00
Le Philousophe 1722511c32 COMMON: Allow to store and fetch paths in configuration 2023-12-24 13:19:25 +01:00
Thierry Crozat c748d1fd6d COMMON: Add ConfMan function to know if a default is set for a key 2023-12-03 16:17:32 +00:00
Matthew Jimenez 5f75054fde COMMON: Skip possible UTF-8 BOM when reading INI files 2023-11-18 20:20:56 +01:00
Attaullah Ansari 83cda889c1 COMMON: Issue warning instead of error dialogs for bad configuration file, return a bool value indicating success or failure of loading. 2023-02-23 18:12:27 +01:00
elasota 3a07524b73 COMMON: Add initial config file option.
This allows an initial/default configuration file to be specified via the command line.  This allows a default settings file to be bundled and loaded even if it's installed to a read-only location, such as Program Files on Windows, and allows the written config file to be deleted without losing the custom defaults.
2023-01-11 14:46:39 +01:00
grisenti 8fccaf89ff ALL: add support for enable-gs and fix bugs 2022-05-29 13:56:21 +02:00
grisenti c0acb85605 ALL: add support for --savepath command 2022-05-29 13:56:21 +02:00
Eugene Sandulenko abea37c9bb ALL: Update ScummVM project license to GPLv3+ 2021-12-26 18:48:43 +01:00
sluicebox 93eeffc84d JANITORIAL: Update old bug tracker numbers 2021-03-03 02:15:05 +02:00
Henrik "Henke37" Andersson 470505cc56 COMMON: ConfMan needs getValOrDefault 2021-02-12 00:41:23 +01:00
Henrik "Henke37" Andersson 2eb52fe900 COMMON: Retire dangerous non const operator[] on ConfMan 2021-02-12 00:41:23 +01:00
Bastien Bouclet bad365c97e COMMON: Add a helper to update a ConfMan entry and flush to disk 2020-06-07 07:40:27 +02:00
Bastien Bouclet 14663c4790 KEYMAPPER: Make the keymapper mandatory 2020-01-29 08:51:29 +01:00
Bastien Bouclet 955e18c648 COMMON: Use nullptr instead of NULL or 0 where appropriate 2018-05-10 08:35:46 +02:00
Adrian Frühwirth 3747d852ee JANITORIAL: Fix whitespace 2018-04-15 16:31:31 +02:00
Eugene Sandulenko 940b2a20f1 Revert "COMMON: Change way the Singleton instances are instantiated"
This reverts commit eefa72afa1.

With this patch ConfigManager is broken.
2017-07-10 21:17:41 +02:00
Thierry Crozat eefa72afa1 COMMON: Change way the Singleton instances are instantiated
This fixes tons of warnings with clang from a recent xcode version on
macOS (and possibly other systems) complaining that an instantiation
of _singleton is required but no definition is available.
2017-07-10 21:11:20 +02:00
Alexander Tkachev 438ba985a4 JANITORIAL: Remove spaces at the end of the line
I knew there were some, but I wanted to fix them once, instead of doing
it all the time.
2016-08-24 16:07:55 +06:00
Alexander Tkachev e743a65636 CLOUD: Add Dropbox into CloudManager's configs
This commit adds:
* ConfMan's new "cloud" domain;
* CloudManager's init() method, where it loads keys from "cloud" configs
domain;
* CurlJsonRequest's addHeader() and addPostField() methods;
* temporary Storage's printInfo() method;
* DropboxStorage's implementation of printInfo(), which is using access
token and user id;
* DropboxStorage's loadFromConfig() static method to load access token
and user id from configs and create a Storage instance with those;
* temporary DropboxStorage's authThroughConsole() static method, which
guides user through auth process from the console.

So, in CloudManager's init() implementation ScummVM checks that there is
"current_storage_type" key in "cloud" domain of configs, and loads
corresponding storage if there is such key.

If there is no such key, ScummVM offers user to auth with Dropbox.
That's done through console, and thus it's temporary (it also requires
restarting ScummVM twice and manually editing config.ini file).
2016-08-24 16:07:55 +06:00
Johannes Schickel e2313433bc COMMON: Use Common::String::clear instead of assigning "". 2014-08-12 01:43:30 +02:00
Torbjörn Andersson 278a14d96e COMMON: Fix crash when quitting on "Game data not found" dialog
ScummVM would try to look up "confirm_exit" in the active domain,
even though the active domain had been removed and pointed to an
invalid address. To avoid this, try to keep _activeDomain and
_activeDomainName updated if removeGameDomain() removes the active
domain.

For good measure, also do it if the active domain is removed by
renameGameDomain(), though I don't know if there was any case where
this would have caused trouble.
2014-08-07 22:55:52 +02:00
Torbjörn Andersson 42c9b1a2c1 COMMON: Minor whitespace fix. 2014-08-07 22:46:24 +02:00
Johannes Schickel 854e22b38b COMMON: Make GPL headers consistent in themselves. 2014-02-18 02:39:33 +01:00
Max Horn 4f8665fc83 COMMON: Move isFoo functions to namespace Common, add doxygen comments 2012-02-20 16:18:27 +01:00
Max Horn 658080deed ALL: Avoid using is* macros from ctype.h
On some systems, passing signed chars to macros like isspace() etc. lead
to a runtime error. Hence, mark these macros as forbidden by default,
and introduce otherwise equivalent alternatives for them.
2012-02-15 16:51:37 +01:00
Christoph Mallon c6d5d74835 COMMON: Make constants actually const. 2011-08-07 15:19:07 +02:00
Christoph Mallon 84220d2ca0 COMMON: Remove superfluous Common:: qualifiers. 2011-08-07 15:19:07 +02:00
Christoph Mallon 23a0f5318c JANITORIAL: Remove trailing empty lines. 2011-08-07 13:53:33 +02:00
Ori Avtalion aa0f307e06 ALL: Require DECLARE_SINGLETON to be used in the Common namepsace
Silences the clang warning:

  static data member specialization of '_singleton' must
  originally be declared in namespace 'Common'; accepted as a C++0x
  extension [-Wc++0x-extensions]

Wrapping "namespace Common {}" around the macro assignment causes clang
to complain about a spurious semicolon, and removing the semicolon at
the end of the macro causes some editors to misbehave.

Changing the requirement of using the macro in one namespace (the
global) to another (Common) seems a small price to pay to
silence a warning.
2011-06-30 22:41:41 +03:00
Littleboy b694a78f62 ANALYSIS: Add static casts to is* functions
This fixes a potential problem with passing char values that would be sign-extended and yield unexpected results.
See http://msdn.microsoft.com/en-us/library/ms245348.aspx
2011-06-23 08:52:52 -04:00
Max Horn da3fff8ab3 COMMON: Make use of Common::parseBool 2011-06-17 10:38:16 +02:00
strangerke 69b1485a22 GIT: Clean up: Suppress SVN tags, now useless 2011-05-12 01:16:22 +02:00
Ori Avtalion 9414d7a6e2 JANITORIAL: Reduce header dependencies in shared code
Some backends may break as I only compiled SDL
2011-04-28 15:08:58 +03:00
Klaus Reimer 48dbbdcd74 COMMON: Fix usage of wrong variable when keymapper is active 2011-04-12 11:05:48 +02:00
dhewg b84b56b248 COMMON: Remove newlines from debug()
They were interfering with my precious debug spew :P
2011-03-02 23:18:34 +01:00
Johannes Schickel 4ad14abef3 COMMON: Some style fixes in config-manager.cpp.
svn-id: r55315
2011-01-18 21:13:47 +00:00
Johannes Schickel da6fdff421 COMMON: Some slight formatting fixes in config-manager.cpp.
svn-id: r55228
2011-01-13 16:38:14 +00:00
Yotam Barnoy 42c8cacde6 CONFIGMANAGER: small changes to support old config files with no 'gameId' keys. As discussed on -devel.
svn-id: r55222
2011-01-13 11:30:37 +00:00
Yotam Barnoy 77a6dc7046 CONFIG-MGR: added ability to add other non-game domains
The way we determine if a domain is a game domain or not when loading from the config file is by checking for a 'gameId' key. This required changing the method of loading somewhat. MiscDomains (ie. non-game domains) are saved to the config file before game domains but after the main domains.

This change shouldn't mess anything up but it could probably use a look-through just in case.

svn-id: r55060
2010-12-29 15:16:31 +00:00
Max Horn abe1959d36 COMMON: Simplify DECLARE_SINGLETON macro
This makes it possible to write
  DECLARE_SINGLETON(foo);
instead of
  DECLARE_SINGLETON(foo)
without causing a warning about an extra semicolon.
The extra semicolon helps some editors at parsing the C++ code.

svn-id: r54258
2010-11-16 08:23:13 +00:00
Yotam Barnoy fdc2a2cd81 CONFIGMAN: added defragmentation methods for one-plugin-at-a-time
One-plugin-at-a-time can have fragmentation caused by the ConfigManager if a game changes any configuration value. By reallocating and copying over the ConfigManager, we avoid this problem.

svn-id: r54243
2010-11-15 13:37:06 +00:00
Max Horn f77b8aee75 COMMON: Switch ConfigManager::setInt & ConfigManager::registerDefault to use String::format
svn-id: r54009
2010-11-01 16:04:04 +00:00
Max Horn 7a85365004 COMMON: Change some (f)printf to debug calls; clenaup hashmap.h
svn-id: r54003
2010-11-01 16:00:53 +00:00
Max Horn db7e69b258 CONFIG: Always sort 'scummvm' and keymapper domains first
svn-id: r52296
2010-08-23 10:00:40 +00:00
Max Horn 69b86db74c Print message when creating new INI; don't rewrite it directly after reading.
Together with the r48651, this addresses bug #2983718:
 "Incomprehensible message for missing scummvm.ini"

svn-id: r48653
2010-04-13 10:08:17 +00:00