Changeset View
Changeset View
Standalone View
Standalone View
kcms/colors/scmeditordialog.cpp
Show First 20 Lines • Show All 95 Lines • ▼ Show 20 Line(s) | 95 | { | |||
---|---|---|---|---|---|
96 | KMessageBox::ButtonCode reallyUpload = KMessageBox::questionYesNo( | 96 | KMessageBox::ButtonCode reallyUpload = KMessageBox::questionYesNo( | ||
97 | this, i18n("This colour scheme was not saved. Continue?"), | 97 | this, i18n("This colour scheme was not saved. Continue?"), | ||
98 | i18n("Do you really want to upload?")); | 98 | i18n("Do you really want to upload?")); | ||
99 | if (reallyUpload == KMessageBox::No) { | 99 | if (reallyUpload == KMessageBox::No) { | ||
100 | return; | 100 | return; | ||
101 | } | 101 | } | ||
102 | } | 102 | } | ||
103 | 103 | | |||
104 | // find path | | |||
105 | const QString path = QStandardPaths::locate(QStandardPaths::GenericDataLocation, | | |||
106 | QStringLiteral("color-schemes/") + m_schemeName + QStringLiteral(".colors")); | | |||
107 | if (path.isEmpty() ) // if the color scheme file wasn't found | | |||
108 | { | | |||
109 | qDebug() << "path for color scheme " << m_schemeName << " couldn't be found"; | | |||
110 | return; | | |||
111 | } | | |||
112 | | ||||
113 | // upload | 104 | // upload | ||
114 | KNS3::UploadDialog dialog(QStringLiteral("colorschemes.knsrc"), this); | 105 | KNS3::UploadDialog dialog(QStringLiteral("colorschemes.knsrc"), this); | ||
115 | dialog.setUploadFile(QUrl::fromLocalFile(path) ); | 106 | dialog.setUploadFile(QUrl::fromLocalFile(m_config->name()) ); | ||
116 | dialog.exec(); | 107 | dialog.exec(); | ||
117 | } | 108 | } | ||
118 | 109 | | |||
119 | void SchemeEditorDialog::on_buttonBox_clicked(QAbstractButton *button) | 110 | void SchemeEditorDialog::on_buttonBox_clicked(QAbstractButton *button) | ||
120 | { | 111 | { | ||
121 | if (buttonBox->standardButton(button) == QDialogButtonBox::Reset) | 112 | if (buttonBox->standardButton(button) == QDialogButtonBox::Reset) | ||
122 | { | 113 | { | ||
123 | m_config->markAsClean(); | 114 | m_config->markAsClean(); | ||
▲ Show 20 Lines • Show All 149 Lines • Show Last 20 Lines |