• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • KDevelop Utility Library
 

KDevelop Utility Library

  • lib
  • util
settings.cpp
1 /***************************************************************************
2  * Copyright (C) 2005 by Jens Dagerbo *
3  * jens.dagerbo@swipnet.se *
4  * *
5  * This program is free software; you can redistribute it and/or modify *
6  * it under the terms of the GNU General Public License as published by *
7  * the Free Software Foundation; either version 2 of the License, or *
8  * (at your option) any later version. *
9  * *
10  ***************************************************************************/
11 
12 #include <tdeconfig.h>
13 #include <tdeglobal.h>
14 #include <kstandarddirs.h>
15 
16 #include "settings.h"
17 
18 TQString Settings::terminalEmulatorName( TDEConfig & config )
19 {
20  config.setGroup("TerminalEmulator");
21  bool useKDESetting = config.readBoolEntry( "UseKDESetting", true );
22  TQString terminal;
23 
24  if ( useKDESetting )
25  {
26  TDEConfigGroup confGroup( TDEGlobal::config(), TQString::fromLatin1("General") );
27  terminal = confGroup.readEntry("TerminalApplication", TQString::fromLatin1("konsole"));
28  }
29  else
30  {
31  terminal = config.readEntry( "TerminalApplication", TQString::fromLatin1("konsole"));
32  }
33  return terminal;
34 }
35 
36 TQString Settings::profileByAttributes(const TQString &language, const TQStringList &keywords)
37 {
38  TDEConfig config(locate("data", "tdevelop/profiles/projectprofiles"));
39  config.setGroup(language);
40 
41  TQStringList profileKeywords = TQStringList::split("/", "Empty");
42  if (config.hasKey("Keywords"))
43  profileKeywords = config.readListEntry("Keywords");
44 
45  int idx = 0;
46  for (TQStringList::const_iterator it = profileKeywords.constBegin();
47  it != profileKeywords.constEnd(); ++it)
48  {
49  if (keywords.contains(*it))
50  {
51  idx = profileKeywords.findIndex(*it);
52  break;
53  }
54  }
55 
56  TQStringList profiles;
57  if (config.hasKey("Profiles"))
58  {
59  profiles = config.readListEntry("Profiles");
60  return profiles[idx];
61  }
62  return "KDevelop";
63 }

KDevelop Utility Library

Skip menu "KDevelop Utility Library"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members

KDevelop Utility Library

Skip menu "KDevelop Utility Library"
  • buildtools
  •   lib
  •     base
  •     parsers
  •       autotools
  •       qmake
  •     widgets
  •   api
  • languages
  •   lib
  •     debugger
  •     designer_integration
  •     interfaces
  • lib
  •   catalog
  •   interfaces
  •     extensions
  •     external
  •     extras
  •   util
  •   widgets
  •     propeditor
  • parts
  •   documentation
  •     interfaces
  • src
  •   profileengine
  •     lib
Generated for KDevelop Utility Library by doxygen 1.8.13
This website is maintained by Timothy Pearson.