[Kstars-devel] branches/kstars/summer/kstars/kstars/tools
Prakash Mohan
prak902000 at gmail.com
Mon Jun 15 20:38:11 CEST 2009
SVN commit 982389 by prakash:
Providing an option for the user to delete all the saved SDSS/DSS images
CCMAIL: kstars-devel at kde.org
M +14 -0 observinglist.cpp
M +4 -0 observinglist.h
M +10 -0 observinglist.ui
--- branches/kstars/summer/kstars/kstars/tools/observinglist.cpp #982388:982389
@@ -177,6 +177,8 @@
this, SLOT( slotChangeTab(int) ) );
connect( ui->saveImages, SIGNAL( clicked() ),
this, SLOT( slotSaveImages() ) );
+ connect( ui->DeleteImages, SIGNAL( clicked() ),
+ this, SLOT( slotDeleteImages() ) );
//Add icons to Push Buttons
ui->OpenButton->setIcon( KIcon("document-open") );
ui->SaveButton->setIcon( KIcon("document-save") );
@@ -1224,4 +1226,16 @@
ivList.append( iv );
iv->show();
}
+
+void ObservingList::slotDeleteImages() {
+ QDirIterator it( KStandardDirs::locateLocal( "appdata", "" ) );
+ while( it.hasNext() )
+ {
+ if( it.fileName().contains( "image" ) && ( ! it.fileName().contains( "dat" ) ) ) {
+ QFile file( it.filePath() );
+ file.remove();
+ }
+ it.next();
+ }
+}
#include "observinglist.moc"
--- branches/kstars/summer/kstars/kstars/tools/observinglist.h #982388:982389
@@ -261,6 +261,10 @@
*/
void slotImageViewer();
+ /**@short Removes all the save DSS/SDSS images from the disk.
+ */
+ void slotDeleteImages();
+
protected slots:
void slotClose();
void downloadReady();
--- branches/kstars/summer/kstars/kstars/tools/observinglist.ui #982388:982389
@@ -418,6 +418,16 @@
</widget>
</item>
<item>
+ <widget class="QPushButton" name="DeleteImages">
+ <property name="toolTip">
+ <string>Deletes all the stored DSS/SDSS images</string>
+ </property>
+ <property name="text">
+ <string>Delete Images</string>
+ </property>
+ </widget>
+ </item>
+ <item>
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
More information about the Kstars-devel
mailing list