diff options
Diffstat (limited to 'src/plugins/General/streambrowser/streamwindow.cpp')
| -rw-r--r-- | src/plugins/General/streambrowser/streamwindow.cpp | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/plugins/General/streambrowser/streamwindow.cpp b/src/plugins/General/streambrowser/streamwindow.cpp index e5dadd958..c662b5ea0 100644 --- a/src/plugins/General/streambrowser/streamwindow.cpp +++ b/src/plugins/General/streambrowser/streamwindow.cpp @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2012-2018 by Ilya Kotov * + * Copyright (C) 2012-2019 by Ilya Kotov * * forkotov02@ya.ru * * * * This program is free software; you can redistribute it and/or modify * @@ -116,6 +116,8 @@ StreamWindow::StreamWindow(QWidget *parent) QDir dir(Qmmp::configDir()); if(!dir.exists("streambrowser")) dir.mkdir("streambrowser"); + //create initial config + createInitialConfig(); //read cache QFile file(Qmmp::configDir() + "/streambrowser/icecast.xml"); if(file.open(QIODevice::ReadOnly)) @@ -430,3 +432,15 @@ void StreamWindow::readXml(QIODevice *input, QStandardItemModel *model) #endif } } + +void StreamWindow::createInitialConfig() +{ + QString config = Qmmp::configDir() + "/streambrowser/favorites.xml"; + QString defaultConfig = Qmmp::dataPath() + "/favorites.xml.default"; + + if(!QFile::exists(config) && QFile::exists(defaultConfig)) + { + qDebug("StreamWindow: creating initial config"); + QFile::copy(defaultConfig, config); + } +} |
