File indexing completed on 2024-05-19 04:56:26

0001 /**
0002  * \file freedbconfig.cpp
0003  * freedb.org import configuration.
0004  *
0005  * \b Project: Kid3
0006  * \author Urs Fleisch
0007  * \date 17 Sep 2003
0008  *
0009  * Copyright (C) 2003-2024  Urs Fleisch
0010  *
0011  * This file is part of Kid3.
0012  *
0013  * Kid3 is free software; you can redistribute it and/or modify
0014  * it under the terms of the GNU General Public License as published by
0015  * the Free Software Foundation; either version 2 of the License, or
0016  * (at your option) any later version.
0017  *
0018  * Kid3 is distributed in the hope that it will be useful,
0019  * but WITHOUT ANY WARRANTY; without even the implied warranty of
0020  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
0021  * GNU General Public License for more details.
0022  *
0023  * You should have received a copy of the GNU General Public License
0024  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
0025  */
0026 
0027 #include "freedbconfig.h"
0028 
0029 int FreedbConfig::s_index = -1;
0030 
0031 /**
0032  * Constructor.
0033  * Set default configuration.
0034  *
0035  * @param grp configuration group
0036  */
0037 FreedbConfig::FreedbConfig(const QString& grp)
0038   : StoredConfig(grp)
0039 {
0040   setServer(QLatin1String("gnudb.gnudb.org:80"));
0041   setCgiPath(QLatin1String("/~cddb/cddb.cgi"));
0042 }
0043 
0044 /**
0045  * Read persisted configuration.
0046  *
0047  * @param config KDE configuration
0048  */
0049 void FreedbConfig::readFromConfig(ISettings* config)
0050 {
0051   ServerImporterConfig::readFromConfig(config);
0052   if (server() == QLatin1String("freedb2.org:80")) {
0053     setServer(QLatin1String("www.gnudb.org:80")); // replace old default
0054   }
0055 }