remove outcommented code, we don't need a shared settings, those settings are...

remove outcommented code, we don't need a shared settings, those settings are shared by virtue of a shared view
parent 28b24bda
......@@ -69,11 +69,11 @@ void CollectionList::loadCachedItems()
// The CollectionList is created with sorting disabled for speed. Re-enable
// it here, and perform the sort.
KConfigGroup config(KGlobal::config(), "Playlists");
Qt::SortOrder order = Qt::DescendingOrder;
if(config.readEntry("CollectionListSortAscending", true))
order = Qt::AscendingOrder;
// KConfigGroup config(KGlobal::config(), "Playlists");
//
// Qt::SortOrder order = Qt::DescendingOrder;
// if(config.readEntry("CollectionListSortAscending", true))
// order = Qt::AscendingOrder;
// ### TODO: View
// m_list->setSortOrder(order);
// m_list->setSortColumn(config.readEntry("CollectionListSortColumn", 1));
......
......@@ -41,7 +41,7 @@ void PlaylistView::contextMenuEvent(QContextMenuEvent *event)
if(!m_contextMenu) {
// Probably more of these actions should be ported over to using KActions.
// ### Probably more of these actions should be ported over to using KActions.
m_contextMenu = new KMenu(this);
......@@ -207,168 +207,6 @@ void PlaylistView::decode(const QMimeData *s, const QModelIndex &index)
playlist()->addFiles(fileList, playlist()->items()[index.row()]);
}
//### TODO: VIEW
/**
* Shared settings between the playlists.
*/
// class Playlist::SharedSettings
// {
// public:
// static SharedSettings *instance();
// /**
// * Sets the default column order to that of Playlist @param p.
// */
// void setColumnOrder(const Playlist *l);
// void toggleColumnVisible(int column);
// void setInlineCompletionMode(KGlobalSettings::Completion mode);
//
// /**
// * Apply the settings.
// */
// void apply(Playlist *l) const;
// void sync() { writeConfig(); }
//
// protected:
// SharedSettings();
// ~SharedSettings() {}
//
// private:
// void writeConfig();
//
// static SharedSettings *m_instance;
// QList<int> m_columnOrder;
// QVector<bool> m_columnsVisible;
// KGlobalSettings::Completion m_inlineCompletion;
// };
// Playlist::SharedSettings *Playlist::SharedSettings::m_instance = 0;
////////////////////////////////////////////////////////////////////////////////
// Playlist::SharedSettings public members
////////////////////////////////////////////////////////////////////////////////
// Playlist::SharedSettings *Playlist::SharedSettings::instance()
// {
// static SharedSettings settings;
// return &settings;
// }
// void Playlist::SharedSettings::setColumnOrder(const Playlist *l)
// {
// if(!l)
// return;
//
// m_columnOrder.clear();
//
// for(int i = l->columnOffset(); i < l->columns(); ++i)
// m_columnOrder.append(l->header()->mapToIndex(i));
//
// writeConfig();
// }
//
// void Playlist::SharedSettings::toggleColumnVisible(int column)
// {
// if(column >= m_columnsVisible.size())
// m_columnsVisible.fill(true, column + 1);
//
// m_columnsVisible[column] = !m_columnsVisible[column];
//
// writeConfig();
// }
//
// void Playlist::SharedSettings::setInlineCompletionMode(KGlobalSettings::Completion mode)
// {
// m_inlineCompletion = mode;
// writeConfig();
// }
//
//
// void Playlist::SharedSettings::apply(Playlist *l) const
// {
// if(!l)
// return;
//
// int offset = l->columnOffset();
// int i = 0;
// foreach(int column, m_columnOrder)
// l->header()->moveSection(i++ + offset, column + offset);
//
// for(int i = 0; i < m_columnsVisible.size(); i++) {
// if(m_columnsVisible[i] && !l->isColumnVisible(i + offset))
// l->showColumn(i + offset, false);
// else if(!m_columnsVisible[i] && l->isColumnVisible(i + offset))
// l->hideColumn(i + offset, false);
// }
//
// l->updateLeftColumn();
// l->renameLineEdit()->setCompletionMode(m_inlineCompletion);
// l->slotColumnResizeModeChanged();
// }
////////////////////////////////////////////////////////////////////////////////
// Playlist::ShareSettings protected members
////////////////////////////////////////////////////////////////////////////////
// Playlist::SharedSettings::SharedSettings()
// {
// KConfigGroup config(KGlobal::config(), "PlaylistShared");
//
// bool resizeColumnsManually = config.readEntry("ResizeColumnsManually", false);
// action("resizeColumnsManually")->setChecked(resizeColumnsManually);
//
// // Preallocate spaces so we don't need to check later.
// m_columnsVisible.fill(true, PlaylistItem::lastColumn() + 1);
//
// // save column order
// m_columnOrder = config.readEntry("ColumnOrder", QList<int>());
//
// QList<int> l = config.readEntry("VisibleColumns", QList<int>());
//
// if(l.isEmpty()) {
//
// // Provide some default values for column visibility if none were
// // read from the configuration file.
//
// m_columnsVisible[PlaylistItem::BitrateColumn] = false;
// m_columnsVisible[PlaylistItem::CommentColumn] = false;
// m_columnsVisible[PlaylistItem::FileNameColumn] = false;
// m_columnsVisible[PlaylistItem::FullPathColumn] = false;
// }
// else {
// // Convert the int list into a bool list.
//
// m_columnsVisible.fill(false);
// for(int i = 0; i < l.size() && i < m_columnsVisible.size(); ++i)
// m_columnsVisible[i] = bool(l[i]);
// }
//
// m_inlineCompletion = KGlobalSettings::Completion(
// config.readEntry("InlineCompletionMode", int(KGlobalSettings::CompletionAuto)));
// }
////////////////////////////////////////////////////////////////////////////////
// Playlist::SharedSettings private members
////////////////////////////////////////////////////////////////////////////////
// void Playlist::SharedSettings::writeConfig()
// {
// KConfigGroup config(KGlobal::config(), "PlaylistShared");
// config.writeEntry("ColumnOrder", m_columnOrder);
//
// QList<int> l;
// for(int i = 0; i < m_columnsVisible.size(); i++)
// l.append(int(m_columnsVisible[i]));
//
// config.writeEntry("VisibleColumns", l);
// config.writeEntry("InlineCompletionMode", int(m_inlineCompletion));
//
// config.writeEntry("ResizeColumnsManually", manualResize());
//
// KGlobal::config()->sync();
// }
// ### TODO: View
// PlaylistItemList Playlist::visibleItems()
// {
......
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