summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAkarsh Simha <akarsh@kde.org>2016-08-25 12:29:53 (GMT)
committerAkarsh Simha <akarsh@kde.org>2016-08-25 12:29:53 (GMT)
commitac6e68f39b1b0eaf31c31f05f6c78a8793b0b0ca (patch)
treee1251b8627cc19ed9ea690ae25f49ffc49770f73
parent92293ef5eba5a1cca75b8f1b790b829ca179b836 (diff)
Rename ObservingList::FileName to ObservingList::m_listFileName
More meaningful variable naming in ObservingList
-rw-r--r--kstars/tools/observinglist.cpp22
-rw-r--r--kstars/tools/observinglist.h2
2 files changed, 13 insertions, 11 deletions
diff --git a/kstars/tools/observinglist.cpp b/kstars/tools/observinglist.cpp
index 59a3479..f4b15ac 100644
--- a/kstars/tools/observinglist.cpp
+++ b/kstars/tools/observinglist.cpp
@@ -112,7 +112,7 @@ ObservingList::ObservingList()
setFocusPolicy(Qt::StrongFocus);
geo = KStarsData::Instance()->geo();
sessionView = false;
- FileName = "";
+ m_listFileName = QString();
pmenu = new ObsListPopupMenu();
//Set up the Table Views
m_WishListModel = new QStandardItemModel( 0, 5, this );
@@ -758,13 +758,13 @@ void ObservingList::slotOpenList()
QTemporaryFile tmpfile;
tmpfile.setAutoRemove(false);
tmpfile.open();
- FileName = tmpfile.fileName();
- if( KIO::NetAccess::download( fileURL, FileName, this ) )
- f.setFileName( FileName );
+ m_listFileName = tmpfile.fileName();
+ if( KIO::NetAccess::download( fileURL, m_listFileName, this ) )
+ f.setFileName( m_listFileName );
} else {
- FileName = fileURL.toLocalFile();
- f.setFileName( FileName );
+ m_listFileName = fileURL.toLocalFile();
+ f.setFileName( m_listFileName );
}
*/
@@ -822,13 +822,15 @@ void ObservingList::slotSaveSessionAs(bool nativeSave) {
QUrl fileURL = QFileDialog::getSaveFileUrl(KStars::Instance(), i18n("Save Observing List"), QUrl(), "KStars Observing List (*.obslist)" );
if ( fileURL.isValid() ) {
- FileName = fileURL.toLocalFile();
+ m_listFileName = fileURL.toLocalFile();
slotSaveSession(nativeSave);
}
}
void ObservingList::slotSaveList() {
QFile f;
+ // FIXME: Move wishlist into a database.
+ // TODO: Support multiple wishlists.
f.setFileName( KSPaths::writableLocation(QStandardPaths::GenericDataLocation) + "wishlist.obslist" ) ;
if ( ! f.open( QIODevice::WriteOnly ) ) {
qDebug() << "Cannot write list to file"; // TODO: This should be presented as a message box to the user
@@ -895,15 +897,15 @@ void ObservingList::slotSaveSession(bool nativeSave) {
return;
}
- if ( FileName.isEmpty() ) {
+ if ( m_listFileName.isEmpty() ) {
slotSaveSessionAs(nativeSave);
return;
}
- QFile f( FileName );
+ QFile f( m_listFileName );
if( ! f.open( QIODevice::WriteOnly ) ) {
QString message = i18n( "Could not open file %1. Try a different filename?", f.fileName() );
if ( KMessageBox::warningYesNo( 0, message, i18n( "Could Not Open File" ), KGuiItem(i18n("Try Different")), KGuiItem(i18n("Do Not Try")) ) == KMessageBox::Yes ) {
- FileName.clear();
+ m_listFileName.clear();
slotSaveSessionAs(nativeSave);
}
return;
diff --git a/kstars/tools/observinglist.h b/kstars/tools/observinglist.h
index a6ef586..82d7a57 100644
--- a/kstars/tools/observinglist.h
+++ b/kstars/tools/observinglist.h
@@ -384,7 +384,7 @@ private:
QList<SkyObject*> m_WishList, m_SessionList;
SkyObject *LogObject, *m_CurrentObject;
bool isModified, bIsLarge, sessionView, dss, singleSelection, showScope, noSelection;
- QString FileName, CurrentImage, DSSUrl, SDSSUrl, ThumbImage, CurrentImagePath;
+ QString m_listFileName, CurrentImage, DSSUrl, SDSSUrl, ThumbImage, CurrentImagePath;
KStarsDateTime dt;
GeoLocation *geo;
QStandardItemModel *m_WishListModel, *m_SessionModel;