diff options
author | toma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-11-25 17:56:58 +0000 |
---|---|---|
committer | toma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-11-25 17:56:58 +0000 |
commit | 114a878c64ce6f8223cfd22d76a20eb16d177e5e (patch) | |
tree | acaf47eb0fa12142d3896416a69e74cbf5a72242 /parts/bookmarks/bookmarks_config.cpp | |
download | tdevelop-114a878c64ce6f8223cfd22d76a20eb16d177e5e.tar.gz tdevelop-114a878c64ce6f8223cfd22d76a20eb16d177e5e.zip |
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdevelop@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'parts/bookmarks/bookmarks_config.cpp')
-rw-r--r-- | parts/bookmarks/bookmarks_config.cpp | 138 |
1 files changed, 138 insertions, 0 deletions
diff --git a/parts/bookmarks/bookmarks_config.cpp b/parts/bookmarks/bookmarks_config.cpp new file mode 100644 index 00000000..095c3f83 --- /dev/null +++ b/parts/bookmarks/bookmarks_config.cpp @@ -0,0 +1,138 @@ +/*************************************************************************** + * Copyright (C) 2003 by Jens Dagerbo * + * jens.dagerbo@swipnet.se * + * * + * 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 <kconfig.h> +#include <kapplication.h> + +#include "bookmarks_config.h" + +BookmarksConfig::BookmarksConfig() +{ + _context = 5; + _codeline = Never; // 0 - Never, 1 - Only if Comment, 2 - Always + _tooltip = true; +} + + +BookmarksConfig::~BookmarksConfig() +{ +} + + +/*! + \fn BookmarksConfig::writeConfig() + */ +void BookmarksConfig::writeConfig() +{ + KConfig *config = kapp->config(); + config->setGroup("Bookmarks"); + + config->writeEntry("Context", _context ); + config->writeEntry("Codeline", _codeline ); + config->writeEntry("ToolTip", _tooltip ); + config->writeEntry("Token", _token ); + + config->sync(); +} + + +/*! + \fn BookmarksConfig::readConfig() + */ +void BookmarksConfig::readConfig() +{ + KConfig *config = kapp->config(); + config->setGroup("Bookmarks"); + + _context = config->readPropertyEntry( "Context", 5 ).toInt(); + _tooltip = config->readBoolEntry( "ToolTip", true ); + _token = config->readEntry( "Token", "//" ); + unsigned int cl = config->readPropertyEntry( "Codeline", 0 ).toInt(); + + switch( cl ) + { + case 1: + _codeline = Token; + break; + case 2: + _codeline = Always; + break; + default: + _codeline = Never; + } + + if ( _context > 15 ) _context = 15; +} + + +/*! + \fn BookmarksConfig::toolTip + */ +bool BookmarksConfig::toolTip() +{ + return _tooltip; +} + + +/*! + \fn BookmarksConfig::codeline + */ +BookmarksConfig::CodeLineType BookmarksConfig::codeline() +{ + return _codeline; +} + + +/*! + \fn BookmarksConfig::context() + */ +unsigned int BookmarksConfig::context() +{ + return _context; +} + + +/*! + \fn BookmarksConfig::setCodeline( CodeLineType ) + */ +void BookmarksConfig::setCodeline( CodeLineType codeline ) +{ + _codeline = codeline; +} + +/*! + \fn BookmarksConfig::setContext( unsigned int ) + */ +void BookmarksConfig::setContext( unsigned int context ) +{ + _context = context; +} + + +/*! + \fn BookmarksConfig::setToolTip( bool ) + */ +void BookmarksConfig::setToolTip( bool tooltip ) +{ + _tooltip = tooltip; +} + +QString BookmarksConfig::token( ) +{ + return _token; +} + +void BookmarksConfig::setToken( QString const & token ) +{ + _token = token; +} + +// kate: space-indent off; indent-width 4; tab-width 4; show-tabs off; |