From 114a878c64ce6f8223cfd22d76a20eb16d177e5e Mon Sep 17 00:00:00 2001 From: toma Date: Wed, 25 Nov 2009 17:56:58 +0000 Subject: 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 --- parts/bookmarks/bookmarks_config.cpp | 138 +++++++++++++++++++++++++++++++++++ 1 file changed, 138 insertions(+) create mode 100644 parts/bookmarks/bookmarks_config.cpp (limited to 'parts/bookmarks/bookmarks_config.cpp') 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 +#include + +#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; -- cgit v1.2.1