• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdenetwork API Reference
  • KDE Home
  • Contact Us
 

kget

  • sources
  • kde-4.12
  • kdenetwork
  • kget
  • transfer-plugins
  • contentfetch
contentfetchsetting.cpp
Go to the documentation of this file.
1 // This file is generated by kconfig_compiler from kget_contentfetchfactory.kcfg.
2 // All changes you do to this file will be lost.
3 
4 #include "contentfetchsetting.h"
5 
6 #include <kglobal.h>
7 #include <QtCore/QFile>
8 
9 class ContentFetchSettingHelper
10 {
11  public:
12  ContentFetchSettingHelper() : q(0) {}
13  ~ContentFetchSettingHelper() { delete q; }
14  ContentFetchSetting *q;
15 };
16 K_GLOBAL_STATIC(ContentFetchSettingHelper, s_globalContentFetchSetting)
17 ContentFetchSetting *ContentFetchSetting::self()
18 {
19  if (!s_globalContentFetchSetting->q) {
20  new ContentFetchSetting;
21  s_globalContentFetchSetting->q->readConfig();
22  }
23 
24  return s_globalContentFetchSetting->q;
25 }
26 
27 ContentFetchSetting::ContentFetchSetting( )
28  : KConfigSkeleton( QLatin1String( "kget_contentfetchfactory.rc" ) )
29 {
30  Q_ASSERT(!s_globalContentFetchSetting->q);
31  s_globalContentFetchSetting->q = this;
32  setCurrentGroup( QLatin1String( "UserScripts" ) );
33 
34  QStringList defaultUrlRegexpList;
35  defaultUrlRegexpList.append( QString::fromUtf8( "youtube.*watch" ) );
36 
37  KConfigSkeleton::ItemStringList *itemUrlRegexpList;
38  itemUrlRegexpList = new KConfigSkeleton::ItemStringList( currentGroup(), QLatin1String( "RegexpItems" ), mUrlRegexpList, defaultUrlRegexpList );
39  addItem( itemUrlRegexpList, QLatin1String( "UrlRegexpList" ) );
40 
41  QStringList searchEngines;
42  searchEngines.append(KStandardDirs::locate("data", "kget/content_fetch_scripts/youtubedl/kget_youtubedl.py"));
43 
44  KConfigSkeleton::ItemStringList *itemPathList;
45  itemPathList = new KConfigSkeleton::ItemStringList( currentGroup(), QLatin1String( "PathItems" ), mPathList, searchEngines );
46  addItem( itemPathList, QLatin1String( "PathList" ) );
47  QStringList defaultDescriptionList;
48  defaultDescriptionList.append( QString::fromUtf8( "A youtube flash video downloader" ) );
49 
50  KConfigSkeleton::ItemStringList *itemDescriptionList;
51  itemDescriptionList = new KConfigSkeleton::ItemStringList( currentGroup(), QLatin1String( "DescriptionItems" ), mDescriptionList, defaultDescriptionList );
52  addItem( itemDescriptionList, QLatin1String( "DescriptionList" ) );
53  QList<int> defaultEnableList;
54  defaultEnableList.append( 1 );
55 
56  KConfigSkeleton::ItemIntList *itemEnableList;
57  itemEnableList = new KConfigSkeleton::ItemIntList( currentGroup(), QLatin1String( "EnableItems" ), mEnableList, defaultEnableList );
58  addItem( itemEnableList, QLatin1String( "EnableList" ) );
59 }
60 
61 ContentFetchSetting::~ContentFetchSetting()
62 {
63  if (!s_globalContentFetchSetting.isDestroyed()) {
64  s_globalContentFetchSetting->q = 0;
65  }
66 }
67 
KConfigSkeleton
ContentFetchSetting::mDescriptionList
QStringList mDescriptionList
Definition: contentfetchsetting.h:102
ContentFetchSetting::ContentFetchSetting
ContentFetchSetting()
Definition: contentfetchsetting.cpp:27
ContentFetchSetting
Definition: contentfetchsetting.h:11
ContentFetchSetting::mEnableList
QList< int > mEnableList
Definition: contentfetchsetting.h:103
contentfetchsetting.h
ContentFetchSetting::mUrlRegexpList
QStringList mUrlRegexpList
Definition: contentfetchsetting.h:100
ContentFetchSetting::~ContentFetchSetting
~ContentFetchSetting()
Definition: contentfetchsetting.cpp:61
ContentFetchSetting::mPathList
QStringList mPathList
Definition: contentfetchsetting.h:101
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:53:17 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

kget

Skip menu "kget"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members

kdenetwork API Reference

Skip menu "kdenetwork API Reference"
  • kget
  • kopete
  •   kopete
  •   libkopete
  • krdc
  • krfb

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal