pluginconf.cpp
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #include <stdlib.h>
00021 #include <sys/param.h>
00022
00023
00024 #include <qfile.h>
00025 #include <qfileinfo.h>
00026 #include <qstring.h>
00027
00028
00029 #include <kglobal.h>
00030 #include <klocale.h>
00031
00032
00033 #include "pluginconf.h"
00034 #include "pluginconf.moc"
00035
00039 PlugInConf::PlugInConf( QWidget *parent, const char *name) : QWidget(parent, name){
00040 kdDebug() << "PlugInConf::PlugInConf: Running" << endl;
00041 QString systemPath(getenv("PATH"));
00042
00043 m_path = QStringList::split(":", systemPath);
00044 m_player = 0;
00045 }
00046
00050 PlugInConf::~PlugInConf(){
00051 kdDebug() << "PlugInConf::~PlugInConf: Running" << endl;
00052 delete m_player;
00053 }
00054
00068 void PlugInConf::load(KConfig* , const QString& ){
00069 kdDebug() << "PlugInConf::load: Running" << endl;
00070 }
00071
00082 void PlugInConf::save(KConfig* , const QString& ){
00083 kdDebug() << "PlugInConf::save: Running" << endl;
00084 }
00085
00093 void PlugInConf::defaults(){
00094 kdDebug() << "PlugInConf::defaults: Running" << endl;
00095 }
00096
00106 bool PlugInConf::supportsMultiInstance() { return true; }
00107
00118 void PlugInConf::setDesiredLanguage(const QString& ) { }
00119
00127 QString PlugInConf::getTalkerCode() { return QString::null; }
00128
00140 QStringList PlugInConf::getSupportedLanguages() { return QStringList(); }
00141
00148 QString PlugInConf::getLocation(const QString &name) {
00149
00150
00151 if (QFile::exists(name)) return name;
00152 kdDebug() << "PluginConf::getLocation: Searching for " << name << " in the path.." << endl;
00153 kdDebug() << m_path << endl;
00154 for(QStringList::iterator it = m_path.begin(); it != m_path.end(); ++it) {
00155 QString fullName = *it;
00156 fullName += "/";
00157 fullName += name;
00158
00159 if(QFile::exists(fullName)) {
00160 return fullName;
00161 kdDebug() << "PluginConf:getLocation: " << fullName << endl;
00162 }
00163
00164 else if(QFileInfo(*it).baseName().append(QString(".").append(QFileInfo(*it).extension())) == name) {
00165 return fullName;
00166 kdDebug() << "PluginConf:getLocation: " << fullName << endl;
00167 }
00168 }
00169 return "";
00170 }
00171
00178 QString PlugInConf::splitLanguageCode(const QString& languageCode, QString& countryCode)
00179 {
00180 QString locale = languageCode;
00181 QString langCode;
00182 QString charSet;
00183 KGlobal::locale()->splitLocale(locale, langCode, countryCode, charSet);
00184 return langCode;
00185 }
00186
00187 QString PlugInConf::realFilePath(const QString &filename)
00188 {
00189 char realpath_buffer[MAXPATHLEN + 1];
00190 memset(realpath_buffer, 0, MAXPATHLEN + 1);
00191
00192
00193 if (realpath( QFile::encodeName(filename).data(), realpath_buffer) != 0) {
00194
00195 return QFile::decodeName(realpath_buffer);
00196 }
00197 return filename;
00198 }
00199
00203 void PlugInConf::setPlayer(TestPlayer* player) { m_player = player; }
00204 TestPlayer* PlugInConf::getPlayer() { return m_player; }
This file is part of the documentation for kttsd Library Version 3.3.90.