• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ GetConfDir函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中GetConfDir函数的典型用法代码示例。如果您正苦于以下问题:C++ GetConfDir函数的具体用法?C++ GetConfDir怎么用?C++ GetConfDir使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了GetConfDir函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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()));
    }
}
开发者ID:gdenning,项目名称:mythtv,代码行数:27,代码来源:storagegroup.cpp


示例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);
    }
}
开发者ID:rjmorse,项目名称:mythtv,代码行数:29,代码来源:decoderhandler.cpp


示例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);
}
开发者ID:StefanRoss,项目名称:mythtv,代码行数:34,代码来源:themechooser.cpp


示例4: GetConfDir

XmlConfiguration::XmlConfiguration( const QString &sFileName )
{
    m_sPath     = GetConfDir();
    m_sFileName = sFileName;
    
    Load();
}
开发者ID:jhludwig,项目名称:mythtv,代码行数:7,代码来源:configuration.cpp


示例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;
}
开发者ID:Olti,项目名称:mythtv,代码行数:30,代码来源:mhi.cpp


示例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());
}
开发者ID:samuelschen,项目名称:mythtv,代码行数:26,代码来源:importicons.cpp


示例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;
}
开发者ID:Beirdo,项目名称:mythtv-stabilize,代码行数:34,代码来源:thumbgenerator.cpp


示例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));
        }
    }
开发者ID:JGunning,项目名称:OpenAOL-TV,代码行数:31,代码来源:channelsettings.cpp


示例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();
}
开发者ID:StefanRoss,项目名称:mythtv,代码行数:30,代码来源:themechooser.cpp


示例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;
}
开发者ID:tomhughes,项目名称:mythtv,代码行数:25,代码来源:hardwareprofile.cpp


示例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;
}
开发者ID:awithers,项目名称:mythtv,代码行数:59,代码来源:backendhousekeeper.cpp


示例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;
}
开发者ID:Cougar,项目名称:mythtv,代码行数:9,代码来源:gamesettings.cpp


示例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);
}
开发者ID:jjohns63,项目名称:mythpandora,代码行数:14,代码来源:mythpandora.cpp


示例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);
}
开发者ID:rmzg,项目名称:mythpianod,代码行数:14,代码来源:mythpianod.cpp


示例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;
}
开发者ID:chadparry,项目名称:mythtv,代码行数:11,代码来源:mythuihelper.cpp


示例16: HostLineEdit

static HostLineEdit *GetBoxartDir()
{
    HostLineEdit *gc = new HostLineEdit("mythgame.boxartdir");
    gc->setLabel(MythGameGeneralSettings::tr("Directory where Game Boxart is "
                                             "stored"));
    gc->setValue(GetConfDir() + "/MythGame/Boxart");
    gc->setHelpText(MythGameGeneralSettings::tr("This directory will be the "
                                                "default browse location when "
                                                "assigning boxart."));
    return gc;
}
开发者ID:Beirdo,项目名称:mythtv-stabilize,代码行数:11,代码来源:gamesettings.cpp


示例17: HostTextEditSetting

static HostTextEditSetting *GetFanartDir()
{
    HostTextEditSetting *gc = new HostTextEditSetting("mythgame.fanartdir");
    gc->setLabel(TR("Directory where Game Fanart is "
                    "stored"));
    gc->setValue(GetConfDir() + "/MythGame/Fanart");
    gc->setHelpText(TR("This directory will be the "
                       "default browse location when "
                       "assigning fanart."));
    return gc;
}
开发者ID:tomhughes,项目名称:mythtv,代码行数:11,代码来源:gamesettings.cpp


示例18: AlbumArtImage

void AlbumArtImages::addImage(const AlbumArtImage &newImage)
{
    // do we already have an image of this type?
    AlbumArtImage *image = NULL;

    AlbumArtList::iterator it = m_imageList.begin();
    for (; it != m_imageList.end(); ++it)
    {
        if ((*it)->imageType == newImage.imageType && (*it)->embedded == newImage.embedded)
        {
            image = *it;
            break;
        }
    }

    if (!image)
    {
        // not found so just add it to the list
        image = new AlbumArtImage(newImage);
        m_imageList.push_back(image);
    }
    else
    {
        // we already have an image of this type so just update it with the new info
        image->filename = newImage.filename;
        image->imageType = newImage.imageType;
        image->embedded = newImage.embedded;
        image->description = newImage.description;
    }

    // if this is an embedded image copy it to disc to speed up its display
    if (image->embedded && m_parent->getTagger()->supportsEmbeddedImages())
    {
        QString path = GetConfDir() + "/MythMusic/AlbumArt/";
        QDir dir(path);

        QString filename = QString("%1-%2.jpg").arg(m_parent->ID()).arg(AlbumArtImages::getTypeFilename(image->imageType));
        if (!QFile::exists(path + filename))
        {
            if (!dir.exists())
                dir.mkpath(path);

            QImage *saveImage = m_parent->getTagger()->getAlbumArt(m_parent->Filename(), image->imageType);
            if (saveImage)
            {
                saveImage->save(path + filename, "JPEG");
                delete saveImage;
            }
        }

        image->filename = path + filename;
    }
}
开发者ID:stunami,项目名称:mythtv,代码行数:53,代码来源:metadata.cpp


示例19: QString

void EditAlbumartDialog::removeCachedImage(const AlbumArtImage *image)
{
    if (!image->embedded)
        return;

    QString imageFilename = QString(GetConfDir() + "/MythMusic/AlbumArt/%1-%2.jpg")
            .arg(m_metadata->ID()).arg(AlbumArtImages::getTypeFilename(image->imageType));

    if (QFile::exists(imageFilename))
        QFile::remove(imageFilename);

    GetMythUI()->RemoveFromCacheByFile(imageFilename);
}
开发者ID:daveyboyc,项目名称:mythtv,代码行数:13,代码来源:editmetadata.cpp


示例20: url

/// search flickr for genre images
void EditMetadataDialog::searchForGenreImages(void)
{
    QString genre= m_metadata->Genre().replace(' ', '+');
    genre = QUrl::toPercentEncoding(genre, "+");

    QUrl url("http://www.flickr.com/search/groups/?w=908425%40N22&m=pool&q=" + genre, QUrl::TolerantMode);

    QString cleanName = fixFilename(m_metadata->Genre().toLower());
    QString file = GetConfDir() + QString("/MythMusic/Icons/%1/%2.jpg").arg("genre").arg(cleanName);

    QFileInfo fi(file);
    GetMythMainWindow()->HandleMedia("WebBrowser", url.toString(), fi.absolutePath() + '/', fi.fileName());
}
开发者ID:daveyboyc,项目名称:mythtv,代码行数:14,代码来源:editmetadata.cpp



注:本文中的GetConfDir函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ GetConfig函数代码示例发布时间:2022-05-30
下一篇:
C++ GetComputerName函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap