Changeset View
Changeset View
Standalone View
Standalone View
scan/sanedialog.cpp
Show First 20 Lines • Show All 57 Lines • ▼ Show 20 Line(s) | 57 | { | |||
---|---|---|---|---|---|
58 | if(!m_ksanew) { | 58 | if(!m_ksanew) { | ||
59 | // new failed | 59 | // new failed | ||
60 | return false; | 60 | return false; | ||
61 | } | 61 | } | ||
62 | if (!m_openDev.isEmpty()) { | 62 | if (!m_openDev.isEmpty()) { | ||
63 | return true; | 63 | return true; | ||
64 | } | 64 | } | ||
65 | // need to select a scanner | 65 | // need to select a scanner | ||
66 | m_openDev = m_ksanew->selectDevice(0); | 66 | m_openDev = m_ksanew->selectDevice(nullptr); | ||
67 | if (m_openDev.isEmpty()) { | 67 | if (m_openDev.isEmpty()) { | ||
68 | // either no scanner was found or then cancel was pressed. | 68 | // either no scanner was found or then cancel was pressed. | ||
69 | return false; | 69 | return false; | ||
70 | } | 70 | } | ||
71 | if (m_ksanew->openDevice(m_openDev) == false) { | 71 | if (m_ksanew->openDevice(m_openDev) == false) { | ||
72 | // could not open the scanner | 72 | // could not open the scanner | ||
73 | KMessageBox::sorry(0, i18n("Opening the selected scanner failed.")); | 73 | KMessageBox::sorry(nullptr, i18n("Opening the selected scanner failed.")); | ||
74 | m_openDev = QString(); | 74 | m_openDev = QString(); | ||
75 | return false; | 75 | return false; | ||
76 | } | 76 | } | ||
77 | 77 | | |||
78 | // restore scan dialog size and all options for the selected device if available | 78 | // restore scan dialog size and all options for the selected device if available | ||
79 | KSharedConfigPtr configPtr = KSharedConfig::openConfig("scannersettings"); | 79 | KSharedConfigPtr configPtr = KSharedConfig::openConfig("scannersettings"); | ||
80 | KWindowConfig::restoreWindowSize(windowHandle(), KConfigGroup(configPtr, "ScanDialog")); | 80 | KWindowConfig::restoreWindowSize(windowHandle(), KConfigGroup(configPtr, "ScanDialog")); | ||
81 | QString groupName = m_openDev; | 81 | QString groupName = m_openDev; | ||
Show All 37 Lines |