MCPcopy Create free account
hub / github.com/KDE/kdevelop / validate

Method validate

plugins/filetemplates/outputpage.cpp:97–121  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

95}
96
97void OutputPagePrivate::validate()
98{
99 QStringList invalidFiles;
100 for(QHash< QString, KUrlRequester* >::const_iterator it = outputFiles.constBegin();
101 it != outputFiles.constEnd(); ++it)
102 {
103 if (!it.value()->url().isValid()) {
104 invalidFiles << it.key();
105 } else if (it.value()->url().isLocalFile() && !QFileInfo(it.value()->url().adjusted(QUrl::RemoveFilename).toLocalFile()).isWritable()) {
106 invalidFiles << it.key();
107 }
108 }
109
110 bool valid = invalidFiles.isEmpty();
111 if (valid) {
112 output->messageWidget->animatedHide();
113 } else {
114 std::sort(invalidFiles.begin(), invalidFiles.end());
115 output->messageWidget->setMessageType(KMessageWidget::Error);
116 output->messageWidget->setCloseButtonVisible(false);
117 output->messageWidget->setText(i18np("Invalid output file: %2", "Invalid output files: %2", invalidFiles.count(), invalidFiles.join(QLatin1String(", "))));
118 output->messageWidget->animatedShow();
119 }
120 emit page->isValid(valid);
121}
122
123OutputPage::OutputPage(QWidget* parent)
124: QWidget(parent)

Callers 1

validateDataMethod · 0.45

Calls 15

sortFunction · 0.85
constBeginMethod · 0.80
constEndMethod · 0.80
isLocalFileMethod · 0.80
toLocalFileMethod · 0.80
setMessageTypeMethod · 0.80
joinMethod · 0.80
QFileInfoClass · 0.50
isValidMethod · 0.45
urlMethod · 0.45
valueMethod · 0.45
keyMethod · 0.45

Tested by

no test coverage detected