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

KDE's Doxygen guidelines are available online.