Changeset View
Changeset View
Standalone View
Standalone View
src/ksanewidget.cpp
Show First 20 Lines • Show All 64 Lines • ▼ Show 20 Line(s) | |||||
65 | static const QString InvetColorsOption = QStringLiteral("KSane::InvertColors"); | 65 | static const QString InvetColorsOption = QStringLiteral("KSane::InvertColors"); | ||
66 | 66 | | |||
67 | KSaneWidget::KSaneWidget(QWidget *parent) | 67 | KSaneWidget::KSaneWidget(QWidget *parent) | ||
68 | : QWidget(parent), d(new KSaneWidgetPrivate(this)) | 68 | : QWidget(parent), d(new KSaneWidgetPrivate(this)) | ||
69 | { | 69 | { | ||
70 | SANE_Int version; | 70 | SANE_Int version; | ||
71 | SANE_Status status; | 71 | SANE_Status status; | ||
72 | 72 | | |||
73 | //qDebug() << "The language is:" << KGlobal::locale()->language(); | | |||
74 | //qDebug() << "Languagelist" << KGlobal::locale()->languageList(); | | |||
75 | | ||||
76 | /* | | |||
77 | see http://community.kde.org/Frameworks/Porting_Notes#KDECore_Changes: | | |||
78 | For translation support, use KLocalizedString (ki18n framework). Translation catalogs are no longer dynamically inserted, | | |||
79 | so the idiom KGlobal::locale()->insertCatalog("somecatalog") is no longer available. | | |||
80 | To simply make the code build, for the sake of porting other things first, just remove or comment out these calls. | | |||
81 | This will stop translations from working, and to fully port them eventually, follow the section | | |||
82 | "Connecting Calls to Catalogs" in ki18n programmer's guide. | | |||
83 | */ | | |||
84 | //KGlobal::locale()->insertCatalog("libksane"); // FIXME KF5 | | |||
85 | //KGlobal::locale()->insertCatalog("sane-backends"); // FIXME KF5 | | |||
86 | | ||||
87 | s_objectMutex.lock(); | 73 | s_objectMutex.lock(); | ||
88 | s_objectCount++; | 74 | s_objectCount++; | ||
89 | 75 | | |||
90 | if (s_objectCount == 1) { | 76 | if (s_objectCount == 1) { | ||
91 | // only call sane init for the first instance | 77 | // only call sane init for the first instance | ||
92 | status = sane_init(&version, &KSaneAuth::authorization); | 78 | status = sane_init(&version, &KSaneAuth::authorization); | ||
93 | if (status != SANE_STATUS_GOOD) { | 79 | if (status != SANE_STATUS_GOOD) { | ||
94 | qDebug() << "libksane: sane_init() failed(" | 80 | qDebug() << "libksane: sane_init() failed(" | ||
▲ Show 20 Lines • Show All 802 Lines • Show Last 20 Lines |