diff --git a/.arcconfig b/.arcconfig new file mode 100644 --- /dev/null +++ b/.arcconfig @@ -0,0 +1,3 @@ +{ + "phabricator.uri" : "https://phabricator.kde.org/" +} diff --git a/.gitignore b/.gitignore --- a/.gitignore +++ b/.gitignore @@ -16,6 +16,6 @@ Makefile avail random_seed -/build*/ +/*build*/ CMakeLists.txt.user* *.unc-backup* diff --git a/app/formatdialog.cpp b/app/formatdialog.cpp --- a/app/formatdialog.cpp +++ b/app/formatdialog.cpp @@ -227,7 +227,7 @@ { nullptr, nullptr, 0, 0 } }; -static QString sLastFormat = QString::null; // format last used, whether +static QString sLastFormat; // format last used, whether // remembered or not FormatDialog::FormatDialog(QWidget *parent, ImageMetaInfo::ImageType type, diff --git a/app/galleryhistory.cpp b/app/galleryhistory.cpp --- a/app/galleryhistory.cpp +++ b/app/galleryhistory.cpp @@ -51,7 +51,7 @@ // Data for display - what the user sees static QString entryName(const FileTreeBranch *branch, const QString &relPath) { - QString name = QString::null; + QString name; FileTreeView *view = static_cast(branch->root()->treeWidget()); if (view == nullptr) { @@ -110,7 +110,7 @@ void GalleryHistory::slotActivated(int idx) { - QString branchName = QString::null; + QString branchName; QString relPath = itemData(idx).toString(); int ix = relPath.indexOf(GALLERY_PATH_SEP); // is the separator present? diff --git a/app/imgprintdialog.cpp b/app/imgprintdialog.cpp --- a/app/imgprintdialog.cpp +++ b/app/imgprintdialog.cpp @@ -318,7 +318,7 @@ return (i18n("A valid size must be specified for custom scaling. One or both of the specified dimensions is zero.")); } - return (QString::null); // no problems + return (QString()); // no problems } diff --git a/app/imgsaver.h b/app/imgsaver.h --- a/app/imgsaver.h +++ b/app/imgsaver.h @@ -101,7 +101,7 @@ ImgSaver::ImageSaveStatus saveImage(const QImage *image, const QUrl &url, const ImageFormat &format, - const QString &subformat = QString::null); + const QString &subformat = QString()); /** * Save an image. @@ -200,7 +200,7 @@ * this must be either 1, 8, 24 or 32. The default is for no colour * conversion. * - * @return The file name as saved, or @c QString::null if there was + * @return The file name as saved, or @c QString() if there was * an error. **/ static QString tempSaveImage(const KookaImage *img, const ImageFormat &format, int colors = -1); diff --git a/app/imgsaver.cpp b/app/imgsaver.cpp --- a/app/imgsaver.cpp +++ b/app/imgsaver.cpp @@ -172,14 +172,16 @@ { if (image == nullptr) return (ImgSaver::SaveStatusParam); - if (!mSaveFormat.isValid()) { // see if have this already + if (!mSaveFormat.isValid()) // see if have this already + { // if not, get from image now //qDebug() << "format not resolved yet"; ImgSaver::ImageSaveStatus stat = getFilenameAndFormat(ImageMetaInfo::findImageType(image)); if (stat != ImgSaver::SaveStatusOk) return (stat); } - if (!mSaveUrl.isValid() || !mSaveFormat.isValid()) { // must have these now + if (!mSaveUrl.isValid() || !mSaveFormat.isValid()) // must have these now + { //qDebug() << "format not resolved!"; return (ImgSaver::SaveStatusParam); } @@ -244,7 +246,7 @@ **/ QString ImgSaver::createFilename() { - if (!m_saveDirectory.isLocalFile()) return (QString::null); + if (!m_saveDirectory.isLocalFile()) return (QString()); // TODO: allow non-local files QDir files(m_saveDirectory.path(), "kscan_[0-9][0-9][0-9][0-9].*"); QStringList l(files.entryList()); @@ -360,43 +362,43 @@ QString ImgSaver::findSubFormat(const ImageFormat &format) { //qDebug() << "for" << format; - return (QString::null); // no subformats currently used + return (QString()); // no subformats currently used } QString ImgSaver::errorString(ImgSaver::ImageSaveStatus status) const { QString re; switch (status) { case ImgSaver::SaveStatusOk: - re = i18n("Save OK"); break; + re = i18n("Save OK"); break; case ImgSaver::SaveStatusPermission: - re = i18n("Permission denied"); break; - case ImgSaver::SaveStatusBadFilename: // never used - re = i18n("Bad file name"); break; - case ImgSaver::SaveStatusNoSpace: // never used - re = i18n("No space left on device"); break; + re = i18n("Permission denied"); break; + case ImgSaver::SaveStatusBadFilename: // never used + re = i18n("Bad file name"); break; + case ImgSaver::SaveStatusNoSpace: // never used + re = i18n("No space left on device"); break; case ImgSaver::SaveStatusFormatNoWrite: - re = i18n("Cannot write image format '%1'", mLastFormat.constData()); break; + re = i18n("Cannot write image format '%1'", mLastFormat.constData()); break; case ImgSaver::SaveStatusProtocol: - re = i18n("Cannot write using protocol '%1'", mLastUrl.scheme()); break; + re = i18n("Cannot write using protocol '%1'", mLastUrl.scheme()); break; case ImgSaver::SaveStatusCanceled: - re = i18n("User cancelled saving"); break; + re = i18n("User cancelled saving"); break; case ImgSaver::SaveStatusMkdir: - re = i18n("Cannot create directory"); break; + re = i18n("Cannot create directory"); break; case ImgSaver::SaveStatusFailed: - re = i18n("Save failed"); break; + re = i18n("Save failed"); break; case ImgSaver::SaveStatusParam: - re = i18n("Bad parameter"); break; + re = i18n("Bad parameter"); break; default: - re = i18n("Unknown status %1", status); break; + re = i18n("Unknown status %1", status); break; } return (re); } bool copyRenameImage(bool isCopying, const QUrl &fromUrl, const QUrl &toUrl, bool askExt, QWidget *overWidget) { - QString errorString = QString::null; + QString errorString; /* Check if the provided filename has a extension */ QString extFrom = extension(fromUrl); @@ -465,7 +467,7 @@ return (false); } - return (true); // file operation succeeded + return (true); // file operation succeeded } bool ImgSaver::renameImage(const QUrl &fromUrl, const QUrl &toUrl, bool askExt, QWidget *overWidget) diff --git a/app/kookaimage.cpp b/app/kookaimage.cpp --- a/app/kookaimage.cpp +++ b/app/kookaimage.cpp @@ -126,7 +126,7 @@ const QString fileName = url.adjusted(QUrl::RemoveFragment).toLocalFile(); qDebug() << "subimage" << subno << "from" << fileName; loadTiffDir(fileName, subno); // load TIFF subimage - return (QString::null); + return (QString()); } } @@ -179,7 +179,7 @@ m_url = url; // record image source m_fileBound = true; // note loaded from file - return (QString::null); // loaded OK + return (QString()); // loaded OK } @@ -258,7 +258,7 @@ #else return (i18n("TIFF not supported")); #endif // HAVE_TIFF - return (QString::null); // TIFF read succeeded + return (QString()); // TIFF read succeeded } diff --git a/app/kookapref.cpp b/app/kookapref.cpp --- a/app/kookapref.cpp +++ b/app/kookapref.cpp @@ -99,9 +99,9 @@ item->setHeader(header); item->setIcon(QIcon::fromTheme(icon)); - int idx = mPages.count(); // index of new item + int idx = mPages.count(); // index of new item mPages.append(item); - return (idx); // index of item added + return (idx); // index of item added } void KookaPref::slotSaveSettings() @@ -137,7 +137,7 @@ // Support for the gallery location - moved here from Previewer class in libkscan -QString KookaPref::sGalleryRoot = QString::null; // global resolved location +QString KookaPref::sGalleryRoot; // global resolved location // The static variable above ensures that the user is only asked // at most once in an application run. @@ -211,7 +211,7 @@ if (galleryName.isEmpty()) { qWarning() << "Gallery name not configured"; - return (QString::null); + return (QString()); } QString oldpath = QStandardPaths::locate(QStandardPaths::AppDataLocation, "ScanImages", QStandardPaths::LocateDirectory); @@ -257,7 +257,7 @@ "then you may do so by simply copying or moving the files.", newpath, oldpath), i18n("New Gallery Created"), - QString::null, + QString(), KMessageBox::Notify | KMessageBox::AllowLink); } } else { // no, don't create diff --git a/app/kookaview.cpp b/app/kookaview.cpp --- a/app/kookaview.cpp +++ b/app/kookaview.cpp @@ -489,7 +489,7 @@ KScanDevice::statusMessage(stat), selDevice.constData()); - int tryAgain = KMessageBox::warningContinueCancel(mMainWindow, msg, QString::null, + int tryAgain = KMessageBox::warningContinueCancel(mMainWindow, msg, QString(), KGuiItem("Retry")); if (tryAgain == KMessageBox::Cancel) { break; @@ -563,7 +563,7 @@ "you need to specify the device to use. " "Use the Add Scan Device option to enter the backend name and parameters, " "or see that dialog for more information."), - QString::null, + QString(), KGuiItem(i18n("Add Scan Device..."))) != KMessageBox::Continue) { return (""); diff --git a/app/scangallery.h b/app/scangallery.h --- a/app/scangallery.h +++ b/app/scangallery.h @@ -127,7 +127,7 @@ private: void loadImageForItem(FileTreeViewItem *item); - FileTreeBranch *openRoot(const QUrl &root, const QString &title = QString::null); + FileTreeBranch *openRoot(const QUrl &root, const QString &title = QString()); FileTreeViewItem *findItemByUrl(const QUrl &url, FileTreeBranch *branch = nullptr); QUrl itemDirectory(const FileTreeViewItem *item) const; diff --git a/app/scangallery.cpp b/app/scangallery.cpp --- a/app/scangallery.cpp +++ b/app/scangallery.cpp @@ -472,7 +472,7 @@ if (isSubImage) // subimages don't show size { item->setIcon(0, QIcon::fromTheme("edit-copy")); - item->setText(1, QString::null); + item->setText(1, QString()); } else { @@ -683,7 +683,7 @@ { item = findItemInBranch(branches().at(0), relPath); } - if (item == nullptr) return; // not found in branch + if (item == nullptr) return; // not found in branch scrollToItem(item); setCurrentItem(item); @@ -699,7 +699,7 @@ #ifdef DEBUG_LOADING qDebug() << "loading" << item->url(); #endif // DEBUG_LOADING - QString ret = QString::null; // no error so far + QString ret; // no error so far ImageFormat format = getImgFormat(item); // check for valid image format if (!format.isValid()) @@ -815,13 +815,13 @@ return (nullptr); // is a directory } - KookaImage *img = imageForItem(curr); // see if already loaded - if (img == nullptr) { // no, try to do that + KookaImage *img = imageForItem(curr); // see if already loaded + if (img == nullptr) { // no, try to do that if (!loadOnDemand) { - return (nullptr); // not loaded, and don't want to + return (nullptr); // not loaded, and don't want to } - slotItemActivated(curr); // select/load this image - img = imageForItem(curr); // and get image for it + slotItemActivated(curr); // select/load this image + img = imageForItem(curr); // and get image for it } return (img); @@ -833,11 +833,11 @@ QString result = ""; const FileTreeViewItem *curr = highlightedFileTreeViewItem(); - if (curr==nullptr) return (QString::null); + if (curr==nullptr) return (QString()); bool isLocal = false; const QUrl u = curr->fileItem()->mostLocalUrl(isLocal); - if (!isLocal) return (QString::null); + if (!isLocal) return (QString()); return (u.toLocalFile()); } @@ -850,12 +850,12 @@ //qDebug() << "type" << info->getImageType(); } - delete mSaver; mSaver = nullptr; // recreate with clean info + delete mSaver; mSaver = nullptr; // recreate with clean info // Resolve where to save the new image when it arrives FileTreeViewItem *curr = highlightedFileTreeViewItem(); - if (curr == nullptr) { // into root if nothing is selected - FileTreeBranch *branch = branches().at(0); // there should be at least one + if (curr == nullptr) { // into root if nothing is selected + FileTreeBranch *branch = branches().at(0); // there should be at least one if (branch != nullptr) { // if user has created this???? curr = findItemInBranch(branch, i18n("Incoming/")); @@ -870,21 +870,21 @@ curr->setSelected(true); } - mSavedTo = curr; // note for selecting later + mSavedTo = curr; // note for selecting later // Create the ImgSaver to use later - QUrl dir(itemDirectory(curr)); // where new image will go - mSaver = new ImgSaver(dir); // create saver to use later + QUrl dir(itemDirectory(curr)); // where new image will go + mSaver = new ImgSaver(dir); // create saver to use later - if (info != nullptr) { // have image information, - // tell saver about it + if (info != nullptr) { // have image information, + // tell saver about it ImgSaver::ImageSaveStatus stat = mSaver->setImageInfo(info); if (stat == ImgSaver::SaveStatusCanceled) { return (false); } } - return (true); // all ready to save + return (true); // all ready to save } QUrl ScanGallery::saveURL() const @@ -907,27 +907,27 @@ //qDebug() << "size" << img->size() << "depth" << img->depth(); if (mSaver == nullptr) { - prepareToSave(nullptr); // if not done already + prepareToSave(nullptr); // if not done already } if (mSaver == nullptr) { - return; // should never happen + return; // should never happen } ImgSaver::ImageSaveStatus isstat = mSaver->saveImage(img); // try to save the image - QUrl lurl = mSaver->lastURL(); // record where it ended up + QUrl lurl = mSaver->lastURL(); // record where it ended up - if (isstat != ImgSaver::SaveStatusOk && // image saving failed + if (isstat != ImgSaver::SaveStatusOk && // image saving failed isstat != ImgSaver::SaveStatusCanceled) { // user cancelled, just ignore KMessageBox::error(this, xi18nc("@info", "Could not save the image%2%1", mSaver->errorString(isstat), lurl.url(QUrl::PreferLocalFile)), i18n("Image Save Error")); } - delete mSaver; mSaver = nullptr; // now finished with this + delete mSaver; mSaver = nullptr; // now finished with this - if (isstat == ImgSaver::SaveStatusOk) { // image was saved OK, + if (isstat == ImgSaver::SaveStatusOk) { // image was saved OK, // select the new image slotSetNextUrlToSelect(lurl); m_nextUrlToShow = lurl; @@ -1097,19 +1097,19 @@ return; } - if (curr->isDir()) { // is a directory + if (curr->isDir()) { // is a directory for (int i = 0; i < curr->childCount(); ++i) { FileTreeViewItem *child = static_cast(curr->child(i)); - slotUnloadItem(child); // recursively unload contents + slotUnloadItem(child); // recursively unload contents } - } else { // is a file/image + } else { // is a file/image const KookaImage *image = imageForItem(curr); if (image == nullptr) { - return; // ok, nothing to unload + return; // ok, nothing to unload } - if (image->subImagesCount() > 0) { // image with subimages - while (curr->childCount() > 0) { // recursively unload subimages + if (image->subImagesCount() > 0) { // image with subimages + while (curr->childCount() > 0) { // recursively unload subimages FileTreeViewItem *child = static_cast(curr->takeChild(0)); slotUnloadItem(child); delete child; @@ -1119,7 +1119,7 @@ emit unloadImage(image); delete image; - curr->setClientData(nullptr); // clear image from item + curr->setClientData(nullptr); // clear image from item slotDecorate(curr); } } @@ -1142,8 +1142,8 @@ return; } - QUrl urlToDel = curr->url(); // item to be deleted - bool isDir = curr->isDir(); // deleting a folder? + QUrl urlToDel = curr->url(); // item to be deleted + bool isDir = curr->isDir(); // deleting a folder? QTreeWidgetItem *nextToSelect = curr->treeWidget()->itemBelow(curr); // select this afterwards QString s; @@ -1180,8 +1180,8 @@ return; } - updateParent(curr); // update parent folder count - if (isDir) { // remove from the name combo + updateParent(curr); // update parent folder count + if (isDir) { // remove from the name combo emit galleryDirectoryRemoved(curr->branch(), itemDirectoryRelative(curr)); } diff --git a/app/scanparamsdialog.cpp b/app/scanparamsdialog.cpp --- a/app/scanparamsdialog.cpp +++ b/app/scanparamsdialog.cpp @@ -179,12 +179,12 @@ void ScanParamsDialog::slotSave() { - QString name = QString::null; + QString name; QListWidgetItem *item = paramsList->currentItem(); if (item != nullptr) name = item->text(); //qDebug() << "selected set" << name; - QString newdesc = QString::null; + QString newdesc; if (sets.contains(name)) { newdesc = sets[name]; } else { diff --git a/app/statusbarmanager.cpp b/app/statusbarmanager.cpp --- a/app/statusbarmanager.cpp +++ b/app/statusbarmanager.cpp @@ -120,7 +120,7 @@ void StatusBarManager::clearStatus(StatusBarManager::Item item) { - setStatus(QString::null, item); + setStatus(QString(), item); } diff --git a/libdialogutil/recentsaver.h b/libdialogutil/recentsaver.h --- a/libdialogutil/recentsaver.h +++ b/libdialogutil/recentsaver.h @@ -92,7 +92,7 @@ * @return The resolved URL, or a null URL if there is no saved * history. **/ - QUrl recentUrl(const QString &suggestedName = QString::null); + QUrl recentUrl(const QString &suggestedName = QString()); /** * Resolve the saved recent location (if there is one) and a suggested @@ -104,7 +104,7 @@ * @return The resolved file path, or a null string if there is no * saved history. **/ - QString recentPath(const QString &suggestedName = QString::null); + QString recentPath(const QString &suggestedName = QString()); /** * Save the location selected by the file dialogue as a new recent location. diff --git a/libfiletree/filetreebranch.cpp b/libfiletree/filetreebranch.cpp --- a/libfiletree/filetreebranch.cpp +++ b/libfiletree/filetreebranch.cpp @@ -307,7 +307,7 @@ // // QUrl url = fi.url(); // //qDebug() << "for" << url; -// url.setFileName(QString::null); +// url.setFileName(QString()); // return (findItemByUrl(url)); //} diff --git a/libkookascan/autoselectbar.cpp b/libkookascan/autoselectbar.cpp --- a/libkookascan/autoselectbar.cpp +++ b/libkookascan/autoselectbar.cpp @@ -67,7 +67,7 @@ // Threshold setting slider/spinbox int maxThresh = item->maxValue().toInt(); - mThresholdSlider = new KScanSlider(nullptr, QString::null, 0, maxThresh); + mThresholdSlider = new KScanSlider(nullptr, QString(), 0, maxThresh); mThresholdSlider->setValue(initialValue); mThresholdSlider->setToolTip(item->toolTip()); l->setBuddy(mThresholdSlider); diff --git a/libkookascan/autoselectdialog.cpp b/libkookascan/autoselectdialog.cpp --- a/libkookascan/autoselectdialog.cpp +++ b/libkookascan/autoselectdialog.cpp @@ -68,7 +68,7 @@ int maxVal = item->maxValue().toInt(); int minVal = item->minValue().toInt(); - mMarginSlider = new KScanSlider(nullptr, QString::null, minVal, maxVal, true, defaultVal); + mMarginSlider = new KScanSlider(nullptr, QString(), minVal, maxVal, true, defaultVal); mMarginSlider->setValue(defaultVal); mMarginSlider->setToolTip(item->toolTip()); connect(mMarginSlider, SIGNAL(settingChanged(int)), SLOT(slotControlChanged())); @@ -93,7 +93,7 @@ maxVal = item->maxValue().toInt(); minVal = item->minValue().toInt(); - mDustsizeSlider = new KScanSlider(nullptr, QString::null, minVal, maxVal, true, defaultVal); + mDustsizeSlider = new KScanSlider(nullptr, QString(), minVal, maxVal, true, defaultVal); mDustsizeSlider->setValue(defaultVal); mDustsizeSlider->setToolTip(item->toolTip()); connect(mDustsizeSlider, SIGNAL(settingChanged(int)), SLOT(slotControlChanged())); diff --git a/libkookascan/kscancontrols.h b/libkookascan/kscancontrols.h --- a/libkookascan/kscancontrols.h +++ b/libkookascan/kscancontrols.h @@ -94,7 +94,7 @@ /** * Get the control's current text value. * - * @return the text value, or @c QString::null for a @c Number + * @return the text value, or @c QString() for a @c Number * or @c Group control. */ virtual QString text() const; diff --git a/libkookascan/kscancontrols.cpp b/libkookascan/kscancontrols.cpp --- a/libkookascan/kscancontrols.cpp +++ b/libkookascan/kscancontrols.cpp @@ -71,7 +71,7 @@ QString KScanControl::text() const { - return (QString::null); + return (QString()); } void KScanControl::setText(const QString &text) {} @@ -257,7 +257,7 @@ QString KScanCheckbox::label() const { - return (QString::null); + return (QString()); } // KScanCombo - combo box with list of options @@ -332,7 +332,7 @@ QString KScanCombo::textAt(int i) const { - return (i == -1 ? QString::null : mCombo->itemData(i).toString()); + return (i == -1 ? QString() : mCombo->itemData(i).toString()); } int KScanCombo::count() const @@ -392,7 +392,7 @@ QString KScanGroup::label() const { - return (QString::null); + return (QString()); } // KScanPushButton - action button @@ -409,5 +409,5 @@ QString KScanPushButton::label() const { - return (QString::null); + return (QString()); } diff --git a/libkookascan/kscandevice.h b/libkookascan/kscandevice.h --- a/libkookascan/kscandevice.h +++ b/libkookascan/kscandevice.h @@ -175,7 +175,7 @@ * If this is a null or empty string, a real scan is performed. * @return The status of the operation **/ - KScanDevice::Status acquireScan(const QString &filename = QString::null); + KScanDevice::Status acquireScan(const QString &filename = QString()); /** * Get the standard file name for saving the preview image for the diff --git a/libkookascan/kscanoptset.h b/libkookascan/kscanoptset.h --- a/libkookascan/kscanoptset.h +++ b/libkookascan/kscanoptset.h @@ -120,7 +120,7 @@ * optSet.saveConfig(saneDevice->scannerBackendName(), setDesc); * @endcode **/ - void saveConfig(const QByteArray &scannerName, const QString &desc = QString::null) const; + void saveConfig(const QByteArray &scannerName, const QString &desc = QString()) const; /** * Load an option set from the global scanner configuration file. diff --git a/libkookascan/kscanoptset.cpp b/libkookascan/kscanoptset.cpp --- a/libkookascan/kscanoptset.cpp +++ b/libkookascan/kscanoptset.cpp @@ -57,7 +57,7 @@ static QString setNameFromGroup(const QString &grpName) { QString prefix = ScanSettings::self()->saveSetDescItem()->group(); - if (!grpName.startsWith(prefix)) return (QString::null); + if (!grpName.startsWith(prefix)) return (QString()); return (grpName.mid(prefix.length()+1)); } diff --git a/libkookascan/scanparams.cpp b/libkookascan/scanparams.cpp --- a/libkookascan/scanparams.cpp +++ b/libkookascan/scanparams.cpp @@ -157,7 +157,7 @@ { addGroup(nullptr); // hide last if present - mLayout->addWidget(new QLabel(QString::null, this), mNextRow, 0, 1, -1, Qt::AlignTop); + mLayout->addWidget(new QLabel(QString(), this), mNextRow, 0, 1, -1, Qt::AlignTop); mLayout->setRowStretch(mNextRow, 9); return (mNextRow > 0); @@ -269,7 +269,7 @@ lay->addWidget(pb, 5, 1, Qt::AlignRight); /* Initialise the progress dialog */ - mProgressDialog = new QProgressDialog(QString::null, i18n("Stop"), 0, 100, nullptr); + mProgressDialog = new QProgressDialog(QString(), i18n("Stop"), 0, 100, nullptr); mProgressDialog->setModal(true); mProgressDialog->setAutoClose(true); mProgressDialog->setAutoReset(true); @@ -279,7 +279,7 @@ // appears to show itself after the default 'minimumDuration' (= 4 seconds), // even despite the previous and no 'value' being set. mProgressDialog->reset(); - setScanDestination(QString::null); // reset destination display + setScanDestination(QString()); // reset destination display connect(mProgressDialog, &QProgressDialog::canceled, mSaneDevice, &KScanDevice::slotStopScanning); connect(mSaneDevice, &KScanDevice::sigScanProgress, this, &ScanParams::slotScanProgress); @@ -362,7 +362,7 @@ // Separator line after these. Using a KScanGroup with a null text, // so that it looks the same as any real group separators following. - frame->addGroup(new KScanGroup(frame, QString::null)); + frame->addGroup(new KScanGroup(frame, QString())); } // Mode setting @@ -449,7 +449,7 @@ frame->addRow(l, mAreaSelect, nullptr, Qt::AlignTop); // Insert another beautification line - frame->addGroup(new KScanGroup(frame, QString::null)); + frame->addGroup(new KScanGroup(frame, QString())); // Source selection mSourceSelect = mSaneDevice->getGuiElement(SANE_NAME_SCAN_SOURCE, frame); @@ -680,7 +680,7 @@ //qDebug() << "new source" << sel_source << "ADF" << adf; /* set the selected Document source, the behavior is stored in a membervar */ - mSourceSelect->set(sel_source.toLatin1()); // TODO: FIX in ScanSourceDialog, then here + mSourceSelect->set(sel_source.toLatin1()); // TODO: FIX in ScanSourceDialog, then here mSourceSelect->apply(); mSourceSelect->reload(); mSourceSelect->redrawWidget(); @@ -712,13 +712,13 @@ { //qDebug() << "scan mode=" << mScanMode; - setScanDestination(QString::null); // reset progress display + setScanDestination(QString()); // reset progress display // Check compatibility of scan settings int format; int depth; mSaneDevice->getCurrentFormat(&format, &depth); - if (depth == 1 && format != SANE_FRAME_GRAY) { // 1-bit scan depth in colour? + if (depth == 1 && format != SANE_FRAME_GRAY) { // 1-bit scan depth in colour? KMessageBox::sorry(this, i18n("1-bit depth scan cannot be done in color")); return (KScanDevice::ParamError); } else if (depth == 16) { @@ -803,8 +803,8 @@ greyPreview->get(&gp); } - setMaximalScanSize(); // always preview at maximal size - mAreaSelect->selectCustomSize(QRect()); // reset selector to reflect that + setMaximalScanSize(); // always preview at maximal size + mAreaSelect->selectCustomSize(QRect()); // reset selector to reflect that stat = mSaneDevice->acquirePreview(gp); if (stat != KScanDevice::Ok) { @@ -823,7 +823,7 @@ //qDebug() << "scan mode=" << mScanMode << "virtfile" << virtfile; - if (mScanMode != ScanParams::VirtualScannerMode) { // acquire via SANE + if (mScanMode != ScanParams::VirtualScannerMode) { // acquire via SANE #if 0 // TODO: port/update if (adf == ADF_OFF) { @@ -874,7 +874,7 @@ void ScanParams::slotEditCustGamma() { - KGammaTable gt; // start with default values + KGammaTable gt; // start with default values // Get the current gamma table from either the combined gamma table // option, or any one of the colour channel gamma tables. @@ -912,9 +912,9 @@ bool reload = false; KScanOption *so = mSaneDevice->getOption(SANE_NAME_CUSTOM_GAMMA); - if (so != nullptr) { // do we have a gamma switch? + if (so != nullptr) { // do we have a gamma switch? int cg = 0; - if (so->get(&cg) && !cg) { // yes, see if already on + if (so->get(&cg) && !cg) { // yes, see if already on // if not, set it on now //qDebug() << "Setting gamma switch on"; so->set(true); @@ -929,7 +929,7 @@ reload |= setGammaTableTo(SANE_NAME_GAMMA_VECTOR_B, gt); if (reload) { - mSaneDevice->reloadAllOptions(); // reload is needed + mSaneDevice->reloadAllOptions(); // reload is needed } } @@ -1013,7 +1013,7 @@ double min1, max1; double min2, max2; - if (!rect.isValid()) { // set full scan area + if (!rect.isValid()) { // set full scan area tl_x->getRange(&min1, &max1); tl_x->set(min1); br_x->getRange(&min1, &max1); br_x->set(max1); tl_y->getRange(&min2, &max2); tl_y->set(min2); @@ -1098,10 +1098,10 @@ //qDebug() << "X/Y resolution" << x_res << y_res; if (y_res == 0) { - y_res = x_res; // use X res if Y unavailable + y_res = x_res; // use X res if Y unavailable } if (x_res == 0) { - x_res = y_res; // unlikely, but orthogonal + x_res = y_res; // unlikely, but orthogonal } if (x_res == 0 && y_res == 0) { @@ -1121,8 +1121,8 @@ qDebug() << "format" << format << "depth" << depth << "-> strips " << strips; - if (strips == 1 && depth == 1) { // bitmap scan - emit scanModeChanged(0); // 8 pixels per byte + if (strips == 1 && depth == 1) { // bitmap scan + emit scanModeChanged(0); // 8 pixels per byte } else { // bytes per pixel emit scanModeChanged(strips * (depth == 16 ? 2 : 1)); diff --git a/libkookascan/scansourcedialog.cpp b/libkookascan/scansourcedialog.cpp --- a/libkookascan/scansourcedialog.cpp +++ b/libkookascan/scansourcedialog.cpp @@ -77,7 +77,7 @@ "Note that you may see more sources than actually exist"), vbox); /* Combo Box for sources */ - d->sources = new KScanCombo(vbox, QString::null); + d->sources = new KScanCombo(vbox, QString()); d->sources->setList(list); connect(d->sources, SIGNAL(activated(int)), SLOT(slotChangeSource(int))); diff --git a/plugins/ocr/abstractocrdialogue.h b/plugins/ocr/abstractocrdialogue.h --- a/plugins/ocr/abstractocrdialogue.h +++ b/plugins/ocr/abstractocrdialogue.h @@ -92,7 +92,7 @@ QProgressBar *progressBar() const; - void ocrShowInfo(const QString &binary, const QString &version = QString::null); + void ocrShowInfo(const QString &binary, const QString &version = QString()); void ocrShowVersion(const QString &version); QWidget *addExtraSetupWidget(QWidget *wid = nullptr, bool stretchBefore = false); diff --git a/plugins/ocr/abstractocrdialogue.cpp b/plugins/ocr/abstractocrdialogue.cpp --- a/plugins/ocr/abstractocrdialogue.cpp +++ b/plugins/ocr/abstractocrdialogue.cpp @@ -445,7 +445,7 @@ { //qDebug() << "pixmap" << newPix.size(); if (m_previewPix != nullptr) { - m_previewPix->setText(QString::null); + m_previewPix->setText(QString()); m_previewPix->setPixmap(newPix); } } diff --git a/plugins/ocr/abstractocrengine.h b/plugins/ocr/abstractocrengine.h --- a/plugins/ocr/abstractocrengine.h +++ b/plugins/ocr/abstractocrengine.h @@ -124,16 +124,16 @@ * this must be either 1, 8, 24 or 32. The default is for no colour * conversion. * - * @return The file name as saved, or @c QString::null if there was + * @return The file name as saved, or @c QString() if there was * an error. **/ QString tempSaveImage(const KookaImage *img, const ImageFormat &format, int colors = -1); /** * Get a name to use for a temporary file. * * @param suffix File name suffix, no leading '.' is required - * @return The temporary file name, or @c QString::null if the file could not be created + * @return The temporary file name, or @c QString() if the file could not be created * * @note The temporary file is created and is left in place under the returned name, * but is not opened. Its name should be saved and eventually returned in the diff --git a/plugins/ocr/abstractocrengine.cpp b/plugins/ocr/abstractocrengine.cpp --- a/plugins/ocr/abstractocrengine.cpp +++ b/plugins/ocr/abstractocrengine.cpp @@ -250,7 +250,7 @@ i18n("OCR Temporary Files"), KStandardGuiItem::del(), KStandardGuiItem::close(), - QString::null, + QString(), KMessageBox::AllowLink)==KMessageBox::Yes) retain = false; } @@ -411,7 +411,7 @@ { qDebug() << "error creating temporary file" << protoName; setErrorText(xi18nc("@info", "Cannot create temporary file %1", protoName)); - return (QString::null); + return (QString()); } QString tmpName = QFile::encodeName(tmpFile.fileName()); @@ -422,7 +422,7 @@ QString AbstractOcrEngine::tempSaveImage(const KookaImage *img, const ImageFormat &format, int colors) { - if (img==nullptr) return (QString::null); // no image to save + if (img==nullptr) return (QString()); // no image to save QString tmpName = tempFileName(format.extension(), "imagetemp"); const KookaImage *tmpImg = nullptr; @@ -445,7 +445,7 @@ break; default: qWarning() << "bad colour depth" << colors; - return (QString::null); + return (QString()); } tmpImg = new KookaImage(img->convertToFormat(newfmt)); diff --git a/plugins/ocr/gocr/ocrgocrdialog.cpp b/plugins/ocr/gocr/ocrgocrdialog.cpp --- a/plugins/ocr/gocr/ocrgocrdialog.cpp +++ b/plugins/ocr/gocr/ocrgocrdialog.cpp @@ -51,7 +51,7 @@ OcrGocrDialog::OcrGocrDialog(AbstractOcrEngine *plugin, QWidget *pnt) : AbstractOcrDialogue(plugin, pnt), - m_ocrCmd(QString::null) + m_ocrCmd(QString()) { } @@ -68,7 +68,7 @@ QLabel *l = new QLabel(ski->label(), w); gl->addWidget(l, 0, 0); - sliderGrayLevel = new KScanSlider(w, QString::null, 0, 254, true, 160); + sliderGrayLevel = new KScanSlider(w, QString(), 0, 254, true, 160); int numdefault = KookaSettings::ocrGocrGrayLevel(); sliderGrayLevel->setValue(numdefault); sliderGrayLevel->setToolTip(ski->toolTip()); @@ -79,7 +79,7 @@ Q_ASSERT(ski!=nullptr); l = new QLabel(ski->label(), w); gl->addWidget(l, 1, 0); - sliderDustSize = new KScanSlider(w, QString::null, 0, 60, true, 10); + sliderDustSize = new KScanSlider(w, QString(), 0, 60, true, 10); numdefault = KookaSettings::ocrGocrDustSize(); sliderDustSize->setValue(numdefault); sliderDustSize->setToolTip(ski->toolTip()); @@ -90,7 +90,7 @@ Q_ASSERT(ski!=nullptr); l = new QLabel(ski->label(), w); gl->addWidget(l, 2, 0); - sliderSpace = new KScanSlider(w, QString::null, 0, 60, true, 0); + sliderSpace = new KScanSlider(w, QString(), 0, 60, true, 0); numdefault = KookaSettings::ocrGocrSpaceWidth(); sliderSpace->setValue(numdefault); sliderSpace->setToolTip(ski->toolTip()); diff --git a/plugins/ocr/gocr/ocrgocrengine.cpp b/plugins/ocr/gocr/ocrgocrengine.cpp --- a/plugins/ocr/gocr/ocrgocrengine.cpp +++ b/plugins/ocr/gocr/ocrgocrengine.cpp @@ -69,8 +69,8 @@ : AbstractOcrEngine(pnt, "OcrGocrEngine") { m_tempDir = nullptr; - m_inputFile = QString::null; // input image file - m_resultFile = QString::null; // OCR result text file + m_inputFile = QString(); // input image file + m_resultFile = QString(); // OCR result text file } diff --git a/plugins/ocr/kadmos/ocrkadmosdialog.cpp b/plugins/ocr/kadmos/ocrkadmosdialog.cpp --- a/plugins/ocr/kadmos/ocrkadmosdialog.cpp +++ b/plugins/ocr/kadmos/ocrkadmosdialog.cpp @@ -288,7 +288,7 @@ slotFontChanged(0); // Load machine print font language list } - ocrShowInfo(QString::null); + ocrShowInfo(QString()); return err; } diff --git a/plugins/ocr/kadmos/ocrkadmosengine.cpp b/plugins/ocr/kadmos/ocrkadmosengine.cpp --- a/plugins/ocr/kadmos/ocrkadmosengine.cpp +++ b/plugins/ocr/kadmos/ocrkadmosengine.cpp @@ -47,7 +47,7 @@ OcrKadmosEngine::OcrKadmosEngine(QWidget *parent) : OcrEngine(parent) { - m_tmpFile = QString::null; + m_tmpFile = QString(); } OcrKadmosEngine::~OcrKadmosEngine() @@ -211,7 +211,7 @@ #ifdef USE_KADMOS_FILEOP if (!m_tmpFile.isNull()) { result << m_tmpFile; - m_tmpFile = QString::null; + m_tmpFile = QString(); } #endif diff --git a/plugins/ocr/ocrad/ocrocraddialog.cpp b/plugins/ocr/ocrad/ocrocraddialog.cpp --- a/plugins/ocr/ocrad/ocrocraddialog.cpp +++ b/plugins/ocr/ocrad/ocrocraddialog.cpp @@ -58,9 +58,9 @@ m_setupWidget(nullptr), m_orfUrlRequester(nullptr), m_layoutMode(0), - m_ocrCmd(QString::null), + m_ocrCmd(QString()), m_versionNum(0), - m_versionStr(QString::null) + m_versionStr(QString()) { } @@ -223,15 +223,15 @@ KookaSettings::setOcrOcradLayoutDetection(m_layoutMode->currentIndex()); int ix = m_characterSet->currentIndex(); - QString value = (m_characterSet->itemData(ix).toBool() ? m_characterSet->currentText() : QString::null); + QString value = (m_characterSet->itemData(ix).toBool() ? m_characterSet->currentText() : QString()); KookaSettings::setOcrOcradCharset(value); ix = m_filter->currentIndex(); - value = (m_filter->itemData(ix).toBool() ? m_filter->currentText() : QString::null); + value = (m_filter->itemData(ix).toBool() ? m_filter->currentText() : QString()); KookaSettings::setOcrOcradFilter(value); ix = m_transform->currentIndex(); - value = (m_transform->itemData(ix).toBool() ? m_transform->currentText() : QString::null); + value = (m_transform->itemData(ix).toBool() ? m_transform->currentText() : QString()); KookaSettings::setOcrOcradTransform(value); KookaSettings::setOcrOcradInvert(m_invert->isChecked()); @@ -252,7 +252,7 @@ if (m_orfUrlRequester != nullptr) { return (m_orfUrlRequester->url().url()); } else { - return (QString::null); + return (QString()); } } diff --git a/plugins/ocr/ocrad/ocrocradengine.cpp b/plugins/ocr/ocrad/ocrocradengine.cpp --- a/plugins/ocr/ocrad/ocrocradengine.cpp +++ b/plugins/ocr/ocrad/ocrocradengine.cpp @@ -58,8 +58,8 @@ OcrOcradEngine::OcrOcradEngine(QObject *pnt, const QVariantList &args) : AbstractOcrEngine(pnt, "OcrOcradEngine") { - m_ocrImagePBM = QString::null; - m_tempOrfName = QString::null; + m_ocrImagePBM = QString(); + m_tempOrfName = QString(); ocradVersion = 0; } @@ -274,7 +274,7 @@ startResultDocument(); while (!stream.atEnd()) { - line = stream.readLine().trimmed(); // line of text excluding '\n' + line = stream.readLine().trimmed(); // line of text excluding '\n' if (line.startsWith("#")) { continue; // ignore comments @@ -284,17 +284,17 @@ //qDebug() << "# Line" << line; } if (line.startsWith("source file ")) { - continue; // source file name, ignore - } else if (line.startsWith("total blocks ")) { // total count of blocks, - // must be first line + continue; // source file name, ignore + } else if (line.startsWith("total blocks ")) { // total count of blocks, + // must be first line blockCnt = line.mid(13).toInt(); qDebug() << "Block count (V<10)" << blockCnt; } else if (line.startsWith("total text blocks ")) { blockCnt = line.mid(18).toInt(); qDebug() << "Block count (V>10)" << blockCnt; } else if (line.startsWith("block ") || line.startsWith("text block ")) { - // start of text block - // matching "block 1 0 0 560 792" + // start of text block + // matching "block 1 0 0 560 792" if (rx1.indexIn(line) == -1) { //qDebug() << "Failed to match 'block' line" << line; continue; @@ -304,9 +304,9 @@ blockRect.setRect(rx1.cap(2).toInt(), rx1.cap(3).toInt(), rx1.cap(4).toInt(), rx1.cap(5).toInt()); //qDebug() << "Current block" << currBlock << "rect" << blockRect; - } else if (line.startsWith("lines ")) { // lines in this block + } else if (line.startsWith("lines ")) { // lines in this block //qDebug() << "Block line count" << line.mid(6).toInt(); - } else if (line.startsWith("line ")) { // start of text line + } else if (line.startsWith("line ")) { // start of text line startLine(); if (rx2.indexIn(line) == -1) { @@ -345,8 +345,8 @@ } int altCount = rx3.cap(1).toInt(); - if (altCount == 0) { // no alternatives, - // undecipherable character + if (altCount == 0) { // no alternatives, + // undecipherable character if (verboseDebug()) { //qDebug() << "Undecipherable character in 'char' line" << charLine; } @@ -374,33 +374,33 @@ } } - if (detectedChar == ' ') { // space terminates the word - if (ocradVersion < 10) { // offset is relative to block + if (detectedChar == ' ') { // space terminates the word + if (ocradVersion < 10) { // offset is relative to block wordRect.translate(blockRect.x(), blockRect.y()); } OcrWordData wd; wd.setProperty(OcrWordData::Rectangle, wordRect); addWord(word, wd); - word = QString::null; // reset for next time + word = QString(); // reset for next time wordRect = QRect(); } else { - word.append(detectedChar); // append char to word + word.append(detectedChar); // append char to word } - } // end of text line loop + } // end of text line loop ++lineNo; - if (!word.isEmpty()) { // last word in line - if (ocradVersion < 10) { // offset is relative to block + if (!word.isEmpty()) { // last word in line + if (ocradVersion < 10) { // offset is relative to block wordRect.translate(blockRect.x(), blockRect.y()); } OcrWordData wd; wd.setProperty(OcrWordData::Rectangle, wordRect); addWord(word, wd); - word = QString::null; // reset for next time + word = QString(); // reset for next time wordRect = QRect(); } @@ -410,11 +410,11 @@ } } - file.close(); // finished with ORF file + file.close(); // finished with ORF file finishResultDocument(); qDebug() << "Finished analysing ORF"; - return (QString::null); // no error detected + return (QString()); // no error detected }