Kstars

opsastrometryindexfiles.cpp
1
2#include "opsastrometryindexfiles.h"
3
4#include "align.h"
5#include "kstars.h"
6#include "ksutils.h"
7#include "Options.h"
8#include "ksnotification.h"
9
10#include <KConfigDialog>
11#include <KMessageBox>
12#include <QFileDialog>
13#include <QDesktopServices>
14
15namespace Ekos
16{
17OpsAstrometryIndexFiles::OpsAstrometryIndexFiles(Align *parent) : QDialog(KStars::Instance())
18{
19 setupUi(this);
20
21 downloadSpeed = 100;
22 actualdownloadSpeed = downloadSpeed;
23 alignModule = parent;
24 manager = new QNetworkAccessManager();
25
26 indexURL->setText("http://data.astrometry.net/");
27
28 //Get a pointer to the KConfigDialog
29 // m_ConfigDialog = KConfigDialog::exists( "alignsetFtings" );
30 connect(openIndexFileDirectory, SIGNAL(clicked()), this, SLOT(slotOpenIndexFileDirectory()));
31
32 astrometryIndex[2.8] = "00";
33 astrometryIndex[4.0] = "01";
34 astrometryIndex[5.6] = "02";
35 astrometryIndex[8] = "03";
36 astrometryIndex[11] = "04";
37 astrometryIndex[16] = "05";
38 astrometryIndex[22] = "06";
39 astrometryIndex[30] = "07";
40 astrometryIndex[42] = "08";
41 astrometryIndex[60] = "09";
42 astrometryIndex[85] = "10";
43 astrometryIndex[120] = "11";
44 astrometryIndex[170] = "12";
45 astrometryIndex[240] = "13";
46 astrometryIndex[340] = "14";
47 astrometryIndex[480] = "15";
48 astrometryIndex[680] = "16";
49 astrometryIndex[1000] = "17";
50 astrometryIndex[1400] = "18";
51 astrometryIndex[2000] = "19";
52
53 QList<QCheckBox *> checkboxes = findChildren<QCheckBox *>();
54
55 connect(indexLocations, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this,
56 &OpsAstrometryIndexFiles::slotUpdate);
57
58 for (auto &checkBox : checkboxes)
59 {
60 connect(checkBox, &QCheckBox::clicked, this, &OpsAstrometryIndexFiles::downloadOrDeleteIndexFiles);
61 }
62
63 QList<QProgressBar *> progressBars = findChildren<QProgressBar *>();
64 QList<QLabel *> qLabels = findChildren<QLabel *>();
65 QList<QPushButton *> qButtons = findChildren<QPushButton *>();
66
67 for (auto &bar : progressBars)
68 {
69 if(bar->objectName().contains("progress"))
70 {
71 bar->setVisible(false);
72 bar->setTextVisible(false);
73 }
74 }
75
76 for (auto &button : qButtons)
77 {
78 if(button->objectName().contains("cancel"))
79 {
80 button->setVisible(false);
81 }
82 }
83
84 for (QLabel * label : qLabels)
85 {
86 if(label->text().contains("info") || label->text().contains("perc"))
87 {
88 label->setVisible(false);
89 }
90 }
91
92 connect(addIndexFileDirectory, &QAbstractButton::clicked, this, [this]()
93 {
94 QString dir = QFileDialog::getExistingDirectory(this, "Load Index File Directory",
98 if (dir.isEmpty())
99 return;
100 addDirectoryToList(dir);
101 });
102 connect(removeIndexFileDirectory, &QAbstractButton::clicked, this, [this]()
103 {
104 if(indexLocations->currentIndex() != 0)
105 removeDirectoryFromList(indexLocations->currentText());
106 });
107
108
109}
110
111void OpsAstrometryIndexFiles::showEvent(QShowEvent *)
112{
113 updateIndexDirectoryList();
114
115}
116
117void OpsAstrometryIndexFiles::updateIndexDirectoryList()
118{
119 // This is needed because they might have directories stored in the config file.
120 // So we can't just use the options folder list.
121 QStringList astrometryDataDirs = KSUtils::getAstrometryDataDirs();
122
123 indexLocations->clear();
124 if(astrometryDataDirs.count() > 1)
125 indexLocations->addItem("All Sources");
126 indexLocations->addItems(astrometryDataDirs);
127 slotUpdate();
128}
129
130void OpsAstrometryIndexFiles::addDirectoryToList(QString directory)
131{
132 QDir dir(directory);
133 if(!dir.exists())
134 return;
135 QString directoryPath = dir.absolutePath();
136
137 QStringList indexFileDirs = Options::astrometryIndexFolderList();
138 if(indexFileDirs.contains(directoryPath))
139 return;
140 indexFileDirs.append(directoryPath);
141 Options::setAstrometryIndexFolderList(indexFileDirs);
142 updateIndexDirectoryList();
143}
144
145void OpsAstrometryIndexFiles::removeDirectoryFromList(QString directory)
146{
147 QStringList indexFileDirs = Options::astrometryIndexFolderList();
148 if(indexFileDirs.contains(directory))
149 {
150 indexFileDirs.removeOne(directory);
151 Options::setAstrometryIndexFolderList(indexFileDirs);
152 updateIndexDirectoryList();
153 }
154}
155
156void OpsAstrometryIndexFiles::slotUpdate()
157{
158 QList<QCheckBox *> checkboxes = findChildren<QCheckBox *>();
159
160 for (auto &checkBox : checkboxes)
161 {
162 checkBox->setChecked(false);
163 }
164
165 if(indexLocations->count() == 0)
166 return;
167
168 double fov_w, fov_h, fov_pixscale;
169
170 // Values in arcmins. Scale in arcsec per pixel
171 alignModule->getFOVScale(fov_w, fov_h, fov_pixscale);
172
173 double fov_check = qMax(fov_w, fov_h);
174
175 FOVOut->setText(QString("%1' x %2'").arg(QString::number(fov_w, 'f', 2), QString::number(fov_h, 'f', 2)));
176
177 QStringList nameFilter("*.fits");
178
179 QStringList astrometryDataDirs = Options::astrometryIndexFolderList();
180
181 bool allDirsSelected = (indexLocations->currentIndex() == 0 && astrometryDataDirs.count() > 1);
182 bool folderIsWriteable;
183
184 QStringList astrometryDataDirsToIndex;
185
186 if(allDirsSelected)
187 {
188 folderDetails->setText(i18n("Downloads Disabled, this is not a directory, it is a list of all index files."));
189 folderIsWriteable = false;
190 astrometryDataDirsToIndex = astrometryDataDirs;
191 openIndexFileDirectory->setEnabled(false);
192 }
193 else
194 {
195 QString folderPath = indexLocations->currentText();
196 folderIsWriteable = QFileInfo(folderPath).isWritable();
197 if(folderIsWriteable)
198 folderDetails->setText(i18n("Downloads Enabled, the directory exists and is writeable."));
199 else
200 folderDetails->setText(i18n("Downloads Disabled, directory permissions issue."));
201 if(!QFileInfo::exists(folderPath))
202 folderDetails->setText(i18n("Downloads Disabled, directory does not exist."));
203 astrometryDataDirsToIndex << folderPath;
204 openIndexFileDirectory->setEnabled(true);
205 }
206 folderDetails->setCursorPosition(0);
207
208 //This loop checks all the folders that are supposed to be checked for the files
209 //It checks the box if it finds them
210 for(auto &astrometryDataDir : astrometryDataDirsToIndex)
211 {
212 QDir directory(astrometryDataDir);
213 QStringList indexList = directory.entryList(nameFilter);
214
215 for (auto &indexName : indexList)
216 {
217 if (fileCountMatches(directory, indexName))
218 {
219 indexName = indexName.replace('-', '_').left(10);
220 QCheckBox *indexCheckBox = findChild<QCheckBox *>(indexName);
221 if (indexCheckBox)
222 indexCheckBox->setChecked(true);
223 }
224 }
225 }
226
227 for (auto &checkBox : checkboxes)
228 {
229 checkBox->setEnabled(folderIsWriteable);
230 checkBox->setIcon(QIcon(":/icons/astrometry-optional.svg"));
231 checkBox->setToolTip(i18n("Optional"));
232 checkBox->setStyleSheet("");
233 }
234
235 float last_skymarksize = 2;
236
237 for (auto &skymarksize : astrometryIndex.keys())
238 {
239 QString indexName1 = "index_41" + astrometryIndex.value(skymarksize);
240 QString indexName2 = "index_42" + astrometryIndex.value(skymarksize);
241 QString indexName3 = "index_52" + astrometryIndex.value(skymarksize);
242 QCheckBox *indexCheckBox1 = findChild<QCheckBox *>(indexName1);
243 QCheckBox *indexCheckBox2 = findChild<QCheckBox *>(indexName2);
244 QCheckBox *indexCheckBox3 = findChild<QCheckBox *>(indexName3);
245 if ((skymarksize >= 0.40 * fov_check && skymarksize <= 0.9 * fov_check) ||
246 (fov_check > last_skymarksize && fov_check < skymarksize))
247 {
248 if (indexCheckBox1)
249 {
250 indexCheckBox1->setIcon(QIcon(":/icons/astrometry-required.svg"));
251 indexCheckBox1->setToolTip(i18n("Required"));
252 }
253 if (indexCheckBox2)
254 {
255 indexCheckBox2->setIcon(QIcon(":/icons/astrometry-required.svg"));
256 indexCheckBox2->setToolTip(i18n("Required"));
257 }
258 if (indexCheckBox3)
259 {
260 indexCheckBox3->setIcon(QIcon(":/icons/astrometry-required.svg"));
261 indexCheckBox3->setToolTip(i18n("Required"));
262 }
263 }
264 else if (skymarksize >= 0.10 * fov_check && skymarksize <= fov_check)
265 {
266 if (indexCheckBox1)
267 {
268 indexCheckBox1->setIcon(QIcon(":/icons/astrometry-recommended.svg"));
269 indexCheckBox1->setToolTip(i18n("Recommended"));
270 }
271 if (indexCheckBox2)
272 {
273 indexCheckBox2->setIcon(QIcon(":/icons/astrometry-recommended.svg"));
274 indexCheckBox2->setToolTip(i18n("Recommended"));
275 }
276 if (indexCheckBox3)
277 {
278 indexCheckBox3->setIcon(QIcon(":/icons/astrometry-recommended.svg"));
279 indexCheckBox3->setToolTip(i18n("Recommended"));
280 }
281 }
282
283 last_skymarksize = skymarksize;
284 }
285
286 //This loop goes over all the directories and adds a stylesheet to change the look of the checkbox text
287 //if the File is installed in any directory. Note that this indicator is then used below in the
288 //Index File download function to check if they really want to do install a file that is installed.
289 for(QString astrometryDataDir : astrometryDataDirs)
290 {
291 QDir directory(astrometryDataDir);
292 QStringList indexList = directory.entryList(nameFilter);
293
294 for (auto &indexName : indexList)
295 {
296 if (fileCountMatches(directory, indexName))
297 {
298 indexName = indexName.replace('-', '_').left(10);
299 QCheckBox *indexCheckBox = findChild<QCheckBox *>(indexName);
300 if (indexCheckBox)
301 indexCheckBox->setStyleSheet("QCheckBox{font-weight: bold; color:green}");
302 }
303 }
304 }
305}
306
307int OpsAstrometryIndexFiles::indexFileCount(QString indexName)
308{
309 int count = 0;
310 if(indexName.contains("4207") || indexName.contains("4206") || indexName.contains("4205"))
311 count = 12;
312 else if(indexName.contains("4204") || indexName.contains("4203") || indexName.contains("4202")
313 || indexName.contains("4201") || indexName.contains("4200") || indexName.contains("5206")
314 || indexName.contains("5205") || indexName.contains("5204") || indexName.contains("5203")
315 || indexName.contains("5202") || indexName.contains("5201") || indexName.contains("5200"))
316 count = 48;
317 else
318 count = 1;
319 return count;
320}
321
322bool OpsAstrometryIndexFiles::fileCountMatches(QDir directory, QString indexName)
323{
324 QString indexNameMatch = indexName.left(10) + "*.fits";
325 QStringList list = directory.entryList(QStringList(indexNameMatch));
326 return list.count() == indexFileCount(indexName);
327}
328
329void OpsAstrometryIndexFiles::slotOpenIndexFileDirectory()
330{
331 if(indexLocations->count() == 0)
332 return;
333 QUrl path = QUrl::fromLocalFile(indexLocations->currentText());
335}
336
337bool OpsAstrometryIndexFiles::astrometryIndicesAreAvailable()
338{
339 auto url = QUrl(indexURL->text());
340 auto response = manager->get(QNetworkRequest(QUrl(url.url(QUrl::RemovePath))));
341 QTimer timeout(this);
342 timeout.setInterval(5000);
343 timeout.setSingleShot(true);
344 timeout.start();
345 while (!response->isFinished())
346 {
347 if (!timeout.isActive())
348 {
349 response->deleteLater();
350 return false;
351 }
352 qApp->processEvents();
353 }
354
355 timeout.stop();
356 bool wasSuccessful = (response->error() == QNetworkReply::NoError);
357 response->deleteLater();
358
359 return wasSuccessful;
360}
361
362void OpsAstrometryIndexFiles::downloadIndexFile(const QString &URL, const QString &fileN, QCheckBox *checkBox,
363 int currentIndex, int maxIndex, double fileSize)
364{
365 QElapsedTimer downloadTime;
366 downloadTime.start();
367
368 QString indexString = QString::number(currentIndex);
369 if (currentIndex < 10)
370 indexString = '0' + indexString;
371
372 QString indexSeriesName = checkBox->text().remove('&');
373 QProgressBar *indexDownloadProgress = findChild<QProgressBar *>(indexSeriesName.replace('-', '_').left(10) + "_progress");
374 QLabel *indexDownloadInfo = findChild<QLabel *>(indexSeriesName.replace('-', '_').left(10) + "_info");
375 QPushButton *indexDownloadCancel = findChild<QPushButton *>(indexSeriesName.replace('-', '_').left(10) + "_cancel");
376 QLabel *indexDownloadPerc = findChild<QLabel *>(indexSeriesName.replace('-', '_').left(10) + "_perc");
377
378 setDownloadInfoVisible(indexSeriesName, checkBox, true);
379
380 if(indexDownloadInfo)
381 {
382 if (indexDownloadProgress && maxIndex > 0)
383 indexDownloadProgress->setValue(currentIndex * 100 / maxIndex);
384 QString info = "(" + QString::number(currentIndex) + '/' + QString::number(maxIndex + 1) + ") ";
385 indexDownloadInfo->setText(info);
386 emit newDownloadProgress(info);
387 }
388
389 QString indexURL = URL;
390
391 indexURL.replace('*', indexString);
392
393 QNetworkReply *response = manager->get(QNetworkRequest(QUrl(indexURL)));
394
395 //Shut it down after too much time elapses.
396 //If the filesize is less than 4 MB, it sets the timeout for 1 minute or 60000 ms.
397 //If it's larger, it assumes a bad download rate of 1 Mbps (100 bytes/ms)
398 //and the calculation estimates the time in milliseconds it would take to download.
399 int timeout = 60000;
400 if(fileSize > 4000000)
401 timeout = fileSize / downloadSpeed;
402 //qDebug()<<"Filesize: "<< fileSize << ", timeout: " << timeout;
403
404 QMetaObject::Connection *cancelConnection = new QMetaObject::Connection();
405 QMetaObject::Connection *replyConnection = new QMetaObject::Connection();
406 QMetaObject::Connection *percentConnection = new QMetaObject::Connection();
407
408 if(indexDownloadPerc)
409 {
410 *percentConnection = connect(response, &QNetworkReply::downloadProgress,
411 [ = ](qint64 bytesReceived, qint64 bytesTotal)
412 {
413 if (indexDownloadProgress)
414 {
415 indexDownloadProgress->setValue(bytesReceived);
416 indexDownloadProgress->setMaximum(bytesTotal);
417 }
418 QString info = QString::number(bytesReceived * 100 / bytesTotal) + '%';
419 indexDownloadPerc->setText(info);
420 emit newDownloadProgress(info);
421 });
422
423 }
424
425 timeoutTimer.disconnect();
426 connect(&timeoutTimer, &QTimer::timeout, this, [&]()
427 {
428 KSNotification::error(
429 i18n("Download Timed out. Either the network is not fast enough, the file is not accessible, or you are not connected."),
430 i18n("Error"), 10);
431 disconnectDownload(cancelConnection, replyConnection, percentConnection);
432 if(response)
433 {
434 response->abort();
435 response->deleteLater();
436 }
437 setDownloadInfoVisible(indexSeriesName, checkBox, false);
438 });
439 timeoutTimer.start(timeout);
440
441 *cancelConnection = connect(indexDownloadCancel, &QPushButton::clicked,
442 [ = ]()
443 {
444 qDebug() << Q_FUNC_INFO << "Download Cancelled.";
445 timeoutTimer.stop();
446 disconnectDownload(cancelConnection, replyConnection, percentConnection);
447 emit newDownloadProgress(i18n("%1 download cancelled.", indexSeriesName));
448 if(response)
449 {
450 response->abort();
451 response->deleteLater();
452 }
453 setDownloadInfoVisible(indexSeriesName, checkBox, false);
454 });
455
456 *replyConnection = connect(response, &QNetworkReply::finished, this,
457 [ = ]()
458 {
459 timeoutTimer.stop();
460 if(response)
461 {
462 disconnectDownload(cancelConnection, replyConnection, percentConnection);
463 setDownloadInfoVisible(indexSeriesName, checkBox, false);
464 response->deleteLater();
465 if (response->error() != QNetworkReply::NoError)
466 {
467 emit newDownloadProgress(response->errorString());
468 KSNotification::error(response->errorString(), i18n("Error"), 10);
469 return;
470 }
471
472 QByteArray responseData = response->readAll();
473 QString indexFileN = fileN;
474
475 indexFileN.replace('*', indexString);
476
477 QFile file(indexFileN);
478 if (QFileInfo(QFileInfo(file).path()).isWritable())
479 {
480 if (!file.open(QIODevice::WriteOnly))
481 {
482 KSNotification::error(i18n("File Write Error"), i18n("Error"), 10);
483 slotUpdate();
484 return;
485 }
486 else
487 {
488 file.write(responseData.data(), responseData.size());
489 file.close();
490 int downloadedFileSize = QFileInfo(file).size();
491 int dtime = downloadTime.elapsed();
492 actualdownloadSpeed = (actualdownloadSpeed + (downloadedFileSize / dtime)) / 2;
493 qDebug() << Q_FUNC_INFO << "Filesize: " << downloadedFileSize << ", time: " << dtime << ", inst speed: " <<
494 downloadedFileSize / dtime <<
495 ", averaged speed: " << actualdownloadSpeed;
496 emit newDownloadProgress(i18n("%1 download complete.", indexSeriesName));
497
498 }
499 }
500 else
501 {
502 KSNotification::error(i18n("Astrometry Folder Permissions Error"), i18n("Error"), 10);
503 }
504
505 if (currentIndex == maxIndex)
506 {
507 slotUpdate();
508 }
509 else
510 downloadIndexFile(URL, fileN, checkBox, currentIndex + 1, maxIndex, fileSize);
511 }
512 });
513}
514
515void OpsAstrometryIndexFiles::setDownloadInfoVisible(QString indexSeriesName, QCheckBox *checkBox, bool set)
516{
517 Q_UNUSED(checkBox);
518
519 QProgressBar *indexDownloadProgress = findChild<QProgressBar *>(indexSeriesName.replace('-', '_').left(10) + "_progress");
520 QLabel *indexDownloadInfo = findChild<QLabel *>(indexSeriesName.replace('-', '_').left(10) + "_info");
521 QPushButton *indexDownloadCancel = findChild<QPushButton *>(indexSeriesName.replace('-', '_').left(10) + "_cancel");
522 QLabel *indexDownloadPerc = findChild<QLabel *>(indexSeriesName.replace('-', '_').left(10) + "_perc");
523 if (indexDownloadProgress)
524 indexDownloadProgress->setVisible(set);
525 if (indexDownloadInfo)
526 indexDownloadInfo->setVisible(set);
527 if (indexDownloadCancel)
528 indexDownloadCancel->setVisible(set);
529 if (indexDownloadPerc)
530 indexDownloadPerc->setVisible(set);
531}
532void OpsAstrometryIndexFiles::disconnectDownload(QMetaObject::Connection *cancelConnection,
533 QMetaObject::Connection *replyConnection, QMetaObject::Connection *percentConnection)
534{
535 if(cancelConnection)
536 disconnect(*cancelConnection);
537 if(replyConnection)
538 disconnect(*replyConnection);
539 if(percentConnection)
540 disconnect(*percentConnection);
541}
542
543void OpsAstrometryIndexFiles::downloadOrDeleteIndexFiles(bool checked)
544{
545 QCheckBox *checkBox = qobject_cast<QCheckBox *>(QObject::sender());
546
547 if (indexLocations->count() == 0)
548 return;
549
550 QString astrometryDataDir = indexLocations->currentText();
551 if(!QFileInfo::exists(astrometryDataDir))
552 {
553 KSNotification::sorry(
554 i18n("The selected Index File directory does not exist. Please either create it or choose another."), i18n("Sorry"), 10);
555 return;
556 }
557
558 if (checkBox)
559 {
560 QString indexSeriesName = checkBox->text().remove('&');
561 QString filePath = astrometryDataDir + '/' + indexSeriesName;
562 QString fileNumString = indexSeriesName.mid(8, 2);
563
564 if (checked)
565 {
566 if(!checkBox->styleSheet().isEmpty()) //This means that the checkbox has a stylesheet so the index file was installed someplace.
567 {
569 nullptr, i18n("The file %1 already exists in another directory. Are you sure you want to download it to this directory as well?",
570 indexSeriesName),
571 i18n("Install File(s)"), KStandardGuiItem::cont(),
572 KStandardGuiItem::cancel(), "install_index_files_warning"))
573 {
574 slotUpdate();
575 return;
576 }
577 }
578 checkBox->setChecked(!checked);
579 if (astrometryIndicesAreAvailable())
580 {
581 QString BASE_URL;
582 QString URL;
583
584 if (this->indexURL->text().endsWith("/"))
585 {
586 BASE_URL = this->indexURL->text();
587 }
588 else
589 {
590 BASE_URL = this->indexURL->text() + "/";
591 }
592
593 if (indexSeriesName.startsWith(QLatin1String("index-41")))
594 URL = BASE_URL + "4100/" + indexSeriesName;
595 else if (indexSeriesName.startsWith(QLatin1String("index-42")))
596 URL = BASE_URL + "4200/" + indexSeriesName;
597 else if (indexSeriesName.startsWith(QLatin1String("index-52")))
598 URL = "https://portal.nersc.gov/project/cosmo/temp/dstn/index-5200/LITE/" + indexSeriesName;
599
600 int maxIndex = indexFileCount(indexSeriesName) - 1;
601
602 double fileSize = 1E11 * qPow(astrometryIndex.key(fileNumString),
603 -1.909); //This estimates the file size based on skymark size obtained from the index number.
604 if(maxIndex != 0)
605 fileSize /= maxIndex; //FileSize is divided between multiple files for some index series.
606 downloadIndexFile(URL, filePath, checkBox, 0, maxIndex, fileSize);
607 }
608 else
609 {
610 KSNotification::sorry(i18n("Could not contact Astrometry Index Server."), i18n("Error"), 10);
611 }
612 }
613 else
614 {
616 nullptr, i18n("Are you sure you want to delete these index files? %1", indexSeriesName),
617 i18n("Delete File(s)"), KStandardGuiItem::cont(),
618 KStandardGuiItem::cancel(), "delete_index_files_warning"))
619 {
620 if (QFileInfo(astrometryDataDir).isWritable())
621 {
622 QStringList nameFilter("*.fits");
623 QDir directory(astrometryDataDir);
624 QStringList indexList = directory.entryList(nameFilter);
625 for (auto &fileName : indexList)
626 {
627 if (fileName.contains(indexSeriesName.left(10)))
628 {
629 if (!directory.remove(fileName))
630 {
631 KSNotification::error(i18n("File Delete Error"), i18n("Error"), 10);
632 slotUpdate();
633 return;
634 }
635 slotUpdate();
636 }
637 }
638 }
639 else
640 {
641 KSNotification::error(i18n("Astrometry Folder Permissions Error"), i18n("Error"), 10);
642 slotUpdate();
643 }
644 }
645 }
646 }
647}
648}
This is the main window for KStars.
Definition kstars.h:89
QString i18n(const char *text, const TYPE &arg...)
Ekos is an advanced Astrophotography tool for Linux.
Definition align.cpp:83
QString path(const QString &relativePath)
ButtonCode warningContinueCancel(QWidget *parent, const QString &text, const QString &title=QString(), const KGuiItem &buttonContinue=KStandardGuiItem::cont(), const KGuiItem &buttonCancel=KStandardGuiItem::cancel(), const QString &dontAskAgainName=QString(), Options options=Notify)
KIOCORE_EXPORT QString dir(const QString &fileClass)
KIOCORE_EXPORT QStringList list(const QString &fileClass)
KGuiItem cont()
KGuiItem cancel()
QString label(StandardShortcut id)
void setChecked(bool)
void clicked(bool checked)
void setIcon(const QIcon &icon)
char * data()
qsizetype size() const const
void currentIndexChanged(int index)
bool openUrl(const QUrl &url)
QStringList entryList(Filters filters, SortFlags sort) const const
QString homePath()
bool remove(const QString &fileName)
qint64 elapsed() const const
QString getExistingDirectory(QWidget *parent, const QString &caption, const QString &dir, Options options)
bool exists() const const
bool isWritable() const const
qint64 size() const const
QString errorString() const const
QByteArray readAll()
void setText(const QString &)
void append(QList< T > &&value)
qsizetype count() const const
bool removeOne(const AT &t)
virtual void abort()=0
void downloadProgress(qint64 bytesReceived, qint64 bytesTotal)
NetworkError error() const const
void deleteLater()
QObject * sender() const const
void setMaximum(int maximum)
void setValue(int value)
bool contains(QChar ch, Qt::CaseSensitivity cs) const const
bool endsWith(QChar c, Qt::CaseSensitivity cs) const const
bool isEmpty() const const
QString left(qsizetype n) const const
QString mid(qsizetype position, qsizetype n) const const
QString number(double n, char format, int precision)
QString & replace(QChar before, QChar after, Qt::CaseSensitivity cs)
bool contains(QLatin1StringView str, Qt::CaseSensitivity cs) const const
QFuture< ArgsType< Signal > > connect(Sender *sender, Signal signal)
void timeout()
QUrl fromLocalFile(const QString &localFile)
void setStyleSheet(const QString &styleSheet)
void setToolTip(const QString &)
virtual void setVisible(bool visible)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 17:04:45 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.