本文整理匯總了C++中GetConfDir函數的典型用法代碼示例。如果您正苦於以下問題:C++ GetConfDir函數的具體用法?C++ GetConfDir怎麽用?C++ GetConfDir使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了GetConfDir函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。
示例1: locker
void StorageGroup::StaticInit(void)
{
QMutexLocker locker(&m_staticInitLock);
if (m_staticInitDone)
return;
m_staticInitDone = true;
m_builtinGroups["ChannelIcons"] = GetConfDir() + "/ChannelIcons";
m_builtinGroups["Themes"] = GetConfDir() + "/themes";
m_builtinGroups["Temp"] = GetConfDir() + "/tmp";
QMap<QString, QString>::iterator it = m_builtinGroups.begin();
for (; it != m_builtinGroups.end(); ++it)
{
QDir qdir(it.value());
if (!qdir.exists())
qdir.mkpath(it.value());
if (!qdir.exists())
LOG(VB_GENERAL, LOG_ERR,
QString("SG() Error: Could not create builtin"
"Storage Group directory '%1' for '%2'").arg(it.value())
.arg(it.key()));
}
}
示例2: LOG
void DecoderHandler::createPlaylistFromRemoteUrl(const QUrl &url)
{
LOG(VB_NETWORK, LOG_INFO,
QString("Retrieving playlist from '%1'").arg(url.toString()));
doOperationStart(tr("Retrieving playlist"));
QString extension = QFileInfo(url.path()).suffix().toLower();
QString saveFilename = GetConfDir() + "/MythMusic/playlist." + extension;
GetMythDownloadManager()->queueDownload(url.toString(), saveFilename, this);
//TODO should find a better way to do this
QTime time;
time.start();
while (m_state == LOADING)
{
if (time.elapsed() > 30000)
{
doOperationStop();
GetMythDownloadManager()->cancelDownload(url.toString());
LOG(VB_GENERAL, LOG_ERR, QString("DecoderHandler:: Timed out trying to download playlist from: %1")
.arg(url.toString()));
m_state = STOPPED;
}
qApp->processEvents();
usleep(500);
}
}
示例3: GetConfDir
void ThemeChooser::removeThemeDir(const QString &dirname)
{
QString themeDir = GetConfDir() + "/themes/";
if ((!dirname.startsWith(themeDir)) &&
(!dirname.startsWith(GetMythUI()->GetThemeCacheDir())))
return;
QDir dir(dirname);
if (!dir.exists())
return;
QFileInfoList list = dir.entryInfoList();
QFileInfoList::const_iterator it = list.begin();
const QFileInfo *fi;
while (it != list.end())
{
fi = &(*it++);
if (fi->fileName() == "." || fi->fileName() == "..")
continue;
if (fi->isFile() && !fi->isSymLink())
{
QFile::remove(fi->absoluteFilePath());
}
else if (fi->isDir() && !fi->isSymLink())
{
removeThemeDir(fi->absoluteFilePath());
}
}
dir.rmdir(dirname);
}
示例4: GetConfDir
XmlConfiguration::XmlConfiguration( const QString &sFileName )
{
m_sPath = GetConfDir();
m_sFileName = sFileName;
Load();
}
示例5: GetConfDir
// Load the font. Copied, generally, from OSD::LoadFont.
bool MHIContext::LoadFont(QString name)
{
QString fullnameA = GetConfDir() + "/" + name;
QByteArray fnameA = fullnameA.toAscii();
FT_Error errorA = FT_New_Face(ft_library, fnameA.constData(), 0, &m_face);
if (!errorA)
return true;
QString fullnameB = GetFontsDir() + name;
QByteArray fnameB = fullnameB.toAscii();
FT_Error errorB = FT_New_Face(ft_library, fnameB.constData(), 0, &m_face);
if (!errorB)
return true;
QString fullnameC = GetShareDir() + "themes/" + name;
QByteArray fnameC = fullnameC.toAscii();
FT_Error errorC = FT_New_Face(ft_library, fnameC.constData(), 0, &m_face);
if (!errorC)
return true;
QString fullnameD = name;
QByteArray fnameD = fullnameD.toAscii();
FT_Error errorD = FT_New_Face(ft_library, fnameD.constData(), 0, &m_face);
if (!errorD)
return true;
LOG(VB_GENERAL, LOG_ERR, QString("[mhi] Unable to find font: %1").arg(name));
return false;
}
示例6: m_strChannelname
ImportIconsWizard::ImportIconsWizard(MythScreenStack *parent, bool fRefresh,
const QString &channelname)
:MythScreenType(parent, "ChannelIconImporter"),
m_strChannelname(channelname), m_fRefresh(fRefresh),
m_nMaxCount(0), m_nCount(0),
m_missingMaxCount(0), m_missingCount(0),
m_url("http://services.mythtv.org/channel-icon/"), m_progressDialog(NULL),
m_iconsList(NULL), m_manualEdit(NULL),
m_nameText(NULL), m_manualButton(NULL),
m_skipButton(NULL), m_statusText(NULL),
m_preview(NULL), m_previewtitle(NULL)
{
m_strChannelname.detach();
if (!m_strChannelname.isEmpty())
LOG(VB_GENERAL, LOG_INFO,
QString("Fetching icon for channel %1").arg(m_strChannelname));
else
LOG(VB_GENERAL, LOG_INFO, "Fetching icons for multiple channels");
m_popupStack = GetMythMainWindow()->GetStack("popup stack");
m_tmpDir = QDir(QString("%1/tmp/icon").arg(GetConfDir()));
if (!m_tmpDir.exists())
m_tmpDir.mkpath(m_tmpDir.absolutePath());
}
示例7: QString
// static function
QString ThumbGenerator::getThumbcacheDir(const QString& inDir)
{
QString galleryDir = gCoreContext->GetSetting("GalleryDir");
// For directory "/my/images/january", this function either returns
// "/my/images/january/.thumbcache" or
// "~/.mythtv/mythgallery/january/.thumbcache"
QString aPath = inDir + QString("/.thumbcache/");
QDir dir(aPath);
if (gCoreContext->GetNumSetting("GalleryThumbnailLocation") &&
!dir.exists() && inDir.startsWith(galleryDir))
{
dir.mkpath(aPath);
}
if (!gCoreContext->GetNumSetting("GalleryThumbnailLocation") ||
!dir.exists() || !inDir.startsWith(galleryDir))
{
// Arrive here if storing thumbs in home dir,
// OR failed to create thumb dir in gallery pics location
int prefixLen = galleryDir.length();
QString location = "";
if (prefixLen < inDir.length())
location = QString("%1/")
.arg(inDir.right(inDir.length() - prefixLen));
aPath = QString("%1/MythGallery/%2").arg(GetConfDir())
.arg(location);
dir.setPath(aPath);
dir.mkpath(aPath);
}
return aPath;
}
示例8: fillSelections
void fillSelections(void)
{
clearSelections();
QString xmltvFile = GetConfDir() + '/' + sourceName + ".xmltv";
if (QFile::exists(xmltvFile))
{
QFile file(xmltvFile);
if (!file.open(QIODevice::ReadOnly | QIODevice::Text))
return;
QStringList idList;
while (!file.atEnd())
{
QByteArray line = file.readLine();
if (line.startsWith("channel="))
{
QString id = line.mid(8, -1).trimmed();
idList.append(id);
}
}
idList.sort();
for (int x = 0; x < idList.size(); x++)
addSelection(idList.at(x), idList.at(x));
}
}
示例9: ShowOkPopup
void ThemeChooser::removeTheme(void)
{
MythUIButtonListItem *current = m_themes->GetItemCurrent();
if (!current)
{
ShowOkPopup(tr("Error, no theme selected."));
return;
}
ThemeInfo *info = qVariantValue<ThemeInfo *>(current->GetData());
if (!info)
{
ShowOkPopup(tr("Error, unable to find current theme."));
return;
}
QString themeDir = GetConfDir() + "/themes/";
if (!info->GetPreviewPath().startsWith(themeDir))
{
ShowOkPopup(tr("%1 is not a user-installed theme and can not "
"be deleted.").arg(info->GetName()));
return;
}
themeDir.append(info->GetDirectoryName());
removeThemeDir(themeDir);
ReloadInBackground();
}
示例10: GetConfDir
QString HardwareProfile::GetPublicUUIDFromFile() const
{
QString ret;
QString pubuuid_file = GetConfDir() + "/HardwareProfile/uuiddb.cfg";
QString pubuuid;
QFile pubfile(pubuuid_file);
if (pubfile.open( QIODevice::ReadOnly ))
{
QString s;
QTextStream stream(&pubfile);
while ( !stream.atEnd() )
{
s = stream.readLine();
if (s.contains(m_uuid))
{
ret = s.section("=",1,1);
ret = ret.trimmed();
}
}
pubfile.close();
}
return ret;
}
示例11: GetConfDir
bool ThemeUpdateTask::DoRun(void)
{
QString MythVersion = MYTH_SOURCE_PATH;
// Treat devel branches as master
if (MythVersion.startsWith("devel/"))
MythVersion = "master";
// FIXME: For now, treat git master the same as svn trunk
if (MythVersion == "master")
MythVersion = "trunk";
if (MythVersion != "trunk")
{
MythVersion = MYTH_BINARY_VERSION; // Example: 0.25.20101017-1
MythVersion.replace(QRegExp("\\.[0-9]{8,}.*"), "");
}
QString remoteThemesDir = GetConfDir();
remoteThemesDir.append("/tmp/remotethemes");
QDir dir(remoteThemesDir);
if (!dir.exists() && !dir.mkpath(remoteThemesDir))
{
LOG(VB_GENERAL, LOG_ERR,
QString("HouseKeeper: Error creating %1"
"directory for remote themes info cache.")
.arg(remoteThemesDir));
return false;
}
QString remoteThemesFile = remoteThemesDir;
remoteThemesFile.append("/themes.zip");
QString url = QString("%1/%2/themes.zip")
.arg(gCoreContext->GetSetting("ThemeRepositoryURL",
"http://themes.mythtv.org/themes/repository")).arg(MythVersion);
bool result = GetMythDownloadManager()->download(url, remoteThemesFile);
if (!result)
{
LOG(VB_GENERAL, LOG_ERR,
QString("HouseKeeper: Error downloading %1"
"remote themes info package.").arg(url));
return false;
}
if (!extractZIP(remoteThemesFile, remoteThemesDir))
{
LOG(VB_GENERAL, LOG_ERR,
QString("HouseKeeper: Error extracting %1"
"remote themes info package.").arg(remoteThemesFile));
QFile::remove(remoteThemesFile);
return false;
}
return true;
}
示例12: HostLineEdit
HostLineEdit *GetScreenshotDir()
{
HostLineEdit *gc = new HostLineEdit("mythgame.screenshotdir");
gc->setLabel(QObject::tr("Directory where Game Screenshots are stored"));
gc->setValue(GetConfDir() + "/MythGame/Screenshots");
gc->setHelpText(QObject::tr("This directory will be the default browse "
"location when assigning screenshots."));
return gc;
}
示例13: MythScreenType
/** \brief Creates a new MythPandora Screen
* \param parent Pointer to the screen stack
* \param name The name of the window
*/
MythPandora::MythPandora(MythScreenStack *parent, QString name) :
MythScreenType(parent, name),
m_coverArtFetcher(NULL),
m_coverArtTempFile(NULL),
m_Timer(NULL)
{
//example of how to find the configuration dir currently used.
QString confdir = GetConfDir();
VERBOSE(VB_IMPORTANT, "MythPandora Conf dir:" + confdir);
}
示例14: MythScreenType
/** \brief Creates a new MythPianod Screen
* \param parent Pointer to the screen stack
* \param name The name of the window
*/
MythPianod::MythPianod(MythScreenStack *parent, QString name) :
MythScreenType(parent, name),
m_coverArtFetcher(NULL),
m_coverArtTempFile(NULL),
m_Timer(NULL) {
//example of how to find the configuration dir currently used.
QString confdir = GetConfDir();
LOG(VB_GENERAL, LOG_INFO, "MythPianod Conf dir:" + confdir);
}
示例15: GetConfDir
QString MythUIHelper::GetThemeCacheDir(void)
{
QString cachedirname = GetConfDir() + "/cache/themecache/";
QString tmpcachedir = cachedirname +
GetMythDB()->GetSetting("Theme", DEFAULT_UI_THEME) +
"." + QString::number(d->m_screenwidth) +
"." + QString::number(d->m_screenheight);
return tmpcachedir;
}