Commit 71fe0152 authored by Scott Wheeler's avatar Scott Wheeler

Update settings reading to the KDE 4 API.

svn path=/trunk/KDE/kdemultimedia/juk/; revision=513939
parent 6f6130ed
......@@ -38,7 +38,7 @@ DeleteWidget::DeleteWidget(QWidget *parent, const char *name)
{
KConfigGroup messageGroup(KGlobal::config(), "FileRemover");
bool deleteInstead = messageGroup.readBoolEntry("deleteInsteadOfTrash", false);
bool deleteInstead = messageGroup.readEntry("deleteInsteadOfTrash", false);
slotShouldDelete(deleteInstead);
ddShouldDelete->setChecked(deleteInstead);
}
......
......@@ -108,7 +108,7 @@ ConfigCategoryReader::ConfigCategoryReader() : CategoryReaderInterface(),
{
KConfigGroup config(KGlobal::config(), "FileRenamer");
Q3ValueList<int> categoryOrder = config.readIntListEntry("CategoryOrder");
Q3ValueList<int> categoryOrder = config.readEntry("CategoryOrder");
unsigned categoryCount[NumTypes] = { 0 }; // Keep track of each category encountered.
// Set a default:
......@@ -129,7 +129,7 @@ ConfigCategoryReader::ConfigCategoryReader() : CategoryReaderInterface(),
m_folderSeparators.resize(m_categoryOrder.count() - 1, false);
Q3ValueList<int> checkedSeparators = config.readIntListEntry("CheckedDirSeparators");
Q3ValueList<int> checkedSeparators = config.readEntry("CheckedDirSeparators");
Q3ValueList<int>::ConstIterator it = checkedSeparators.constBegin();
for(; it != checkedSeparators.constEnd(); ++it) {
......@@ -138,7 +138,7 @@ ConfigCategoryReader::ConfigCategoryReader() : CategoryReaderInterface(),
m_folderSeparators[index] = true;
}
m_musicFolder = config.readPathEntry("MusicFolder", "${HOME}/music");
m_musicFolder = config.readEntry("MusicFolder", "${HOME}/music");
m_separator = config.readEntry("Separator", " - ");
}
......@@ -270,7 +270,7 @@ void FileRenamerWidget::loadConfig()
for(unsigned i = 0; i < m_rows.count(); ++i)
m_rows[i].options = TagRenamerOptions(m_rows[i].category);
checkedSeparators = config.readIntListEntry("CheckedDirSeparators");
checkedSeparators = config.readEntry("CheckedDirSeparators");
Q3ValueList<int>::ConstIterator it = checkedSeparators.begin();
for(; it != checkedSeparators.end(); ++it) {
......@@ -279,7 +279,7 @@ void FileRenamerWidget::loadConfig()
m_folderSwitches[separator]->setChecked(true);
}
QString url = config.readPathEntry("MusicFolder", "${HOME}/music");
QString url = config.readEntry("MusicFolder", "${HOME}/music");
m_musicFolder->setURL(url);
m_separator->setCurrentText(config.readEntry("Separator", " - "));
......@@ -476,7 +476,7 @@ void FileRenamerWidget::addFolderSeparatorCheckbox()
void FileRenamerWidget::createTagRows()
{
KConfigGroup config(KGlobal::config(), "FileRenamer");
Q3ValueList<int> categoryOrder = config.readIntListEntry("CategoryOrder");
Q3ValueList<int> categoryOrder = config.readEntry("CategoryOrder");
if(categoryOrder.isEmpty())
categoryOrder << Artist << Album << Artist << Title << Track;
......
......@@ -281,8 +281,8 @@ void JuK::keyPressEvent(QKeyEvent *e)
void JuK::readSettings()
{
KConfigGroup config(KGlobal::config(), "Settings");
m_showSplash = config.readBoolEntry("ShowSplashScreen", true);
m_startDocked = config.readBoolEntry("StartDocked", false);
m_showSplash = config.readEntry("ShowSplashScreen", true);
m_startDocked = config.readEntry("StartDocked", false);
}
void JuK::readConfig()
......@@ -293,7 +293,7 @@ void JuK::readConfig()
if(m_sliderAction->volumeSlider()) {
int maxVolume = m_sliderAction->volumeSlider()->maxValue();
int volume = playerConfig.readNumEntry("Volume", maxVolume);
int volume = playerConfig.readEntry("Volume", maxVolume);
m_sliderAction->volumeSlider()->setVolume(volume);
}
......@@ -307,24 +307,24 @@ void JuK::readConfig()
else if(randomPlayMode == "AlbumRandomPlay")
ActionCollection::action<KToggleAction>("albumRandomPlay")->setChecked(true);
bool loopPlaylist = playerConfig.readBoolEntry("LoopPlaylist", false);
bool loopPlaylist = playerConfig.readEntry("LoopPlaylist", false);
ActionCollection::action<KToggleAction>("loopPlaylist")->setChecked(loopPlaylist);
// general settings
KConfigGroup settingsConfig(KGlobal::config(), "Settings");
bool dockInSystemTray = settingsConfig.readBoolEntry("DockInSystemTray", true);
bool dockInSystemTray = settingsConfig.readEntry("DockInSystemTray", true);
m_toggleSystemTrayAction->setChecked(dockInSystemTray);
bool dockOnClose = settingsConfig.readBoolEntry("DockOnClose", true);
bool dockOnClose = settingsConfig.readEntry("DockOnClose", true);
m_toggleDockOnCloseAction->setChecked(dockOnClose);
bool showPopups = settingsConfig.readBoolEntry("TrackPopup", false);
bool showPopups = settingsConfig.readEntry("TrackPopup", false);
m_togglePopupsAction->setChecked(showPopups);
if(m_outputSelectAction)
m_outputSelectAction->setCurrentItem(settingsConfig.readNumEntry("MediaSystem", 0));
m_outputSelectAction->setCurrentItem(settingsConfig.readEntry("MediaSystem", 0));
m_toggleSplashAction->setChecked(m_showSplash);
}
......
......@@ -83,7 +83,7 @@ KeyDialog::KeyDialog(KGlobalAccel *keys, KActionCollection *actionCollection,
int selectedButton;
KConfigGroup config(KGlobal::config(), "Shortcuts");
selectedButton = config.readNumEntry("GlobalKeys", StandardKeys);
selectedButton = config.readEntry("GlobalKeys", StandardKeys);
// Create widgets for key chooser - widget stack used to replace key chooser
......
......@@ -87,7 +87,7 @@ int main(int argc, char *argv[])
bool startDocked;
KConfigGroup config(KGlobal::config(), "Settings");
startDocked = config.readBoolEntry("StartDocked", false);
startDocked = config.readEntry("StartDocked", false);
if(!startDocked)
juk->show();
......
......@@ -250,13 +250,13 @@ Playlist::SharedSettings::SharedSettings()
{
KConfigGroup config(KGlobal::config(), "PlaylistShared");
bool resizeColumnsManually = config.readBoolEntry("ResizeColumnsManually", false);
bool resizeColumnsManually = config.readEntry("ResizeColumnsManually", false);
action<KToggleAction>("resizeColumnsManually")->setChecked(resizeColumnsManually);
// save column order
m_columnOrder = config.readIntListEntry("ColumnOrder");
m_columnOrder = config.readEntry("ColumnOrder");
Q3ValueList<int> l = config.readIntListEntry("VisibleColumns");
Q3ValueList<int> l = config.readEntry("VisibleColumns");
if(l.isEmpty()) {
......@@ -289,7 +289,7 @@ Playlist::SharedSettings::SharedSettings()
}
m_inlineCompletion = KGlobalSettings::Completion(
config.readNumEntry("InlineCompletionMode", KGlobalSettings::CompletionAuto));
config.readEntry("InlineCompletionMode", KGlobalSettings::CompletionAuto));
}
////////////////////////////////////////////////////////////////////////////////
......
......@@ -265,7 +265,7 @@ void PlaylistBox::removePlaylist(Playlist *playlist)
void PlaylistBox::readConfig()
{
KConfigGroup config(KGlobal::config(), "PlaylistBox");
m_viewModeIndex = config.readNumEntry("ViewMode", 0);
m_viewModeIndex = config.readEntry("ViewMode", 0);
}
void PlaylistBox::saveConfig()
......@@ -681,7 +681,7 @@ void PlaylistBox::setupItem(Item *item)
void PlaylistBox::setupUpcomingPlaylist()
{
KConfigGroup config(KGlobal::config(), "Playlists");
bool enable = config.readBoolEntry("showUpcoming", false);
bool enable = config.readEntry("showUpcoming", false);
setUpcomingPlaylistEnabled(enable);
action<KToggleAction>("showUpcoming")->setChecked(enable);
......
......@@ -815,8 +815,8 @@ void PlaylistCollection::readConfig()
{
KConfigGroup config(KGlobal::config(), "Playlists");
m_importPlaylists = config.readBoolEntry("ImportPlaylists", true);
m_folderList = config.readPathListEntry("DirectoryList");
m_importPlaylists = config.readEntry("ImportPlaylists", true);
m_folderList = config.readEntry("DirectoryList");
for(QStringList::ConstIterator it = m_folderList.begin(); it != m_folderList.end(); ++it)
m_dirLister.openURL(*it, true);
......
......@@ -193,14 +193,14 @@ void PlaylistSplitter::readConfig()
{
KConfigGroup config(KGlobal::config(), "Splitter");
Q3ValueList<int> splitterSizes = config.readIntListEntry("PlaylistSplitterSizes");
Q3ValueList<int> splitterSizes = config.readEntry("PlaylistSplitterSizes");
if(splitterSizes.isEmpty()) {
splitterSizes.append(100);
splitterSizes.append(640);
}
setSizes(splitterSizes);
bool showSearch = config.readBoolEntry("ShowSearch", true);
bool showSearch = config.readEntry("ShowSearch", true);
action<KToggleAction>("showSearch")->setChecked(showSearch);
m_searchWidget->setShown(showSearch);
}
......
......@@ -436,7 +436,7 @@ void TagEditor::readConfig()
readCompletionMode(&config, m_genreBox, "GenreBoxMode");
}
bool show = config.readBoolEntry("Show", false);
bool show = config.readEntry("Show", false);
action<KToggleAction>("showEditor")->setChecked(show);
setShown(show);
......@@ -455,7 +455,7 @@ void TagEditor::readConfig()
void TagEditor::readCompletionMode(KConfigBase *config, KComboBox *box, const QString &key)
{
KGlobalSettings::Completion mode =
KGlobalSettings::Completion(config->readNumEntry(key, KGlobalSettings::CompletionAuto));
KGlobalSettings::Completion(config->readEntry(key, KGlobalSettings::CompletionAuto));
box->setCompletionMode(mode);
}
......
......@@ -114,7 +114,7 @@ QStringList TagGuesser::schemeStrings()
QStringList schemes;
KConfigGroup config(KGlobal::config(), "TagGuesser");
schemes = config.readListEntry("Filename schemes");
schemes = config.readEntry("Filename schemes");
if ( schemes.isEmpty() ) {
schemes += "%a - (%T) - %t [%c]";
......
......@@ -81,8 +81,8 @@ TagRenamerOptions::TagRenamerOptions(const CategoryID &category)
setEmptyAction(UseReplacementValue);
setEmptyText(config.readEntry(QString("%1EmptyText").arg(typeKey)));
setTrackWidth(config.readUnsignedNumEntry(QString("%1TrackWidth").arg(typeKey)));
setDisabled(config.readBoolEntry(QString("%1Disabled").arg(typeKey), disabled));
setTrackWidth(config.readEntry(QString("%1TrackWidth").arg(typeKey)));
setDisabled(config.readEntry(QString("%1Disabled").arg(typeKey), disabled));
}
QString TagRenamerOptions::tagTypeText(TagType type, bool translate)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment