• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdeedu API Reference
  • KDE Home
  • Contact Us
 

kstars

  • sources
  • kde-4.12
  • kdeedu
  • kstars
  • kstars
  • skycomponents
culturelist.cpp
Go to the documentation of this file.
1 /***************************************************************************
2  culturelist.cpp - K Desktop Planetarium
3  -------------------
4  begin : 04 Nov. 2008
5  copyright : (C) 2008 by Jerome SONRIER
6  email : jsid@emor3j.fr.eu.org
7  ***************************************************************************/
8 
9 /***************************************************************************
10  * *
11  * This program is free software; you can redistribute it and/or modify *
12  * it under the terms of the GNU General Public License as published by *
13  * the Free Software Foundation; either version 2 of the License, or *
14  * (at your option) any later version. *
15  * *
16  ***************************************************************************/
17 
18 #include "culturelist.h"
19 #include "ksfilereader.h"
20 #include "Options.h"
21 
22 
23 CultureList::CultureList()
24 {
25  KSFileReader fileReader;
26  if ( ! fileReader.open( "cnames.dat" ) )
27  return;
28 
29  while ( fileReader.hasMoreLines() ) {
30  QString line = fileReader.readLine();
31  if ( line.size() < 1 ) continue;
32 
33  QChar mode = line.at( 0 );
34  if ( mode == 'C' )
35  m_CultureList << line.mid( 2 ).trimmed();
36  }
37 
38  m_CultureList.sort();
39  m_CurrentCulture = m_CultureList.at( Options::skyCulture() );
40 }
41 
42 void CultureList::setCurrent ( QString newName ) {
43  m_CurrentCulture = newName;
44 }
45 
46 QString CultureList::getName( int index ) {
47  return m_CultureList.value( index );
48 }
KSFileReader::hasMoreLines
bool hasMoreLines()
Definition: ksfilereader.h:108
Options::skyCulture
static uint skyCulture()
Get Sky culture.
Definition: Options.h:1151
CultureList::setCurrent
void setCurrent(QString newName)
Set the current culture name.
Definition: culturelist.cpp:42
culturelist.h
KSFileReader::open
bool open(const QString &fname)
Definition: ksfilereader.cpp:46
Options.h
ksfilereader.h
KSFileReader::readLine
QString readLine()
Definition: ksfilereader.h:113
KSFileReader
Definition: ksfilereader.h:65
CultureList::getName
QString getName(int index)
Return the name of the culture at index.
Definition: culturelist.cpp:46
CultureList::CultureList
CultureList()
Create culture list and load its conternt from file.
Definition: culturelist.cpp:23
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:36:19 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

kstars

Skip menu "kstars"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdeedu API Reference

Skip menu "kdeedu API Reference"
  • Analitza
  •     lib
  • kalgebra
  • kalzium
  •   libscience
  • kanagram
  • kig
  •   lib
  • klettres
  • kstars
  • libkdeedu
  •   keduvocdocument
  • marble
  • parley
  • rocs
  •   App
  •   RocsCore
  •   VisualEditor
  •   stepcore

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal