Esempio n. 1
0
LanguageListModel::LanguageListModel(ModelType type, QObject* parent)
 : QStringListModel(parent)
 , m_sortModel(new QSortFilterProxyModel(this))
#ifndef NOKDE
 , m_systemLangList(new KConfig(QLatin1String("locale/kf5_all_languages"), KConfig::NoGlobals, QStandardPaths::GenericDataLocation))
#endif
{
#ifndef NOKDE
    setStringList(m_systemLangList->groupList());
#else
    QStringList ll;
    QList<QLocale> allLocales = QLocale::matchingLocales(QLocale::AnyLanguage, QLocale::AnyScript, QLocale::AnyCountry);
    foreach(const QLocale& l, allLocales)
        ll.append(l.name());
    ll=ll.toSet().toList();
    setStringList(ll);
#endif

    if (type==WithEmptyLang) insertRows(rowCount(), 1);
#if 0 //KDE5PORT
    KIconLoader::global()->addExtraDesktopThemes();
#endif
    //qWarning()<<KIconLoader::global()->hasContext(KIconLoader::International);
    //qDebug()<<KIconLoader::global()->queryIconsByContext(KIconLoader::NoGroup,KIconLoader::International);
    m_sortModel->setSourceModel(this);
    m_sortModel->sort(0);
}
Esempio n. 2
0
void SoundCloudNavModel::reload() {
    if (SoundCloud::instance()->userId().isEmpty()) {
        setStringList(QStringList() << tr("Accounts") << tr("Search"));
    }
    else {
        setStringList(QStringList() << tr("Accounts") << tr("Search") << tr("Tracks") << tr("Favourites") << tr("Sets")
                                    << tr("Followings"));
    }
}
Esempio n. 3
0
MySubModel::MySubModel(const QString& name)
{
	QStringList myList;
	for (int i = 0; i < 5; ++i)
		myList << QString("%1 item %2").arg(name).arg(i);
	setStringList(myList);
}
	MethodModel(QObject *parent, bool supportsSinglePass)
		: QStringListModel(parent), m_supportsSinglePass(supportsSinglePass) {
		QStringList tmp;
		tmp << "Disable"
			<< "OpenGL";
		setStringList(tmp);
	}
Esempio n. 5
0
void FilesModel::setCurrentFolder( QString folder )
{
	// doing some checks 
	if( true  == folder.isEmpty() )
		return;
	
	QDir directory;
	directory.setPath( folder );
	
	QStringList folderContent = directory.entryList();
	
	// removing the "."
	folderContent.removeAt(0);
	
	setStringList( folderContent );
	m_fileInfoList = directory.entryInfoList();
	
	// removing info for "."
	m_fileInfoList.removeAt(0);
	

	// storing the folder beeing displaied
	m_currentFolder = directory.absolutePath();

}
Esempio n. 6
0
TagCompletionModel::TagCompletionModel(LibraryBackend* backend, Playlist::Column column)
  : QStringListModel()
{
  QString col = database_column(column);
  if (!col.isEmpty()) {
    setStringList(backend->GetAll(col));
  }
}
Esempio n. 7
0
void GasSelectionModel::repopulate()
{
	/* TODO:
	 * getGasList shouldn't be a member of DivePlannerPointsModel,
	 * it has nothing to do with the current plain being calculated:
	 * it's internal to the current_dive.
	 */
	setStringList(DivePlannerPointsModel::instance()->getGasList());
}
Esempio n. 8
0
QStringList Settings::stringList(QString key, QStringList default_value)
{
  QStringList value = valueWithFallback(key, default_value).toStringList();
  if (value==default_value)
  {
    setStringList(key, default_value);
  }
  return value;
}
	MethodModel(QObject *parent, bool supportsSinglePass) 
		: QStringListModel(parent), m_supportsSinglePass(supportsSinglePass) {
		QStringList tmp;
		tmp << "Disable"
			<< "OpenGL"
			<< "OpenGL (single pass)"
			<< "Coherent ray tracing"
			<< "Standard ray tracing";
		setStringList(tmp);
	}
Esempio n. 10
0
void TagCompletionModel::updateModel()
{
	if (g_tag_list == NULL)
		return;
	QStringList list;
	struct tag_entry *current_tag_entry = g_tag_list->next;
	while (current_tag_entry != NULL) {
		list.append(QString(current_tag_entry->tag->name));
		current_tag_entry = current_tag_entry->next;
	}
	setStringList(list);
}
Esempio n. 11
0
void GasSelectionModel::repopulate()
{
	setStringList(DivePlannerPointsModel::instance()->getGasList());
}
Esempio n. 12
0
void
NameListModel::load (const QStringList & names)
{
  usage.clear();
  setStringList (names);
}
Esempio n. 13
0
PoolModel::PoolModel(QObject* _parent) : QStringListModel(_parent) {
  setStringList(Settings::instance().getMiningPoolList());
}