Changeset View
Changeset View
Standalone View
Standalone View
autotests/searchtest.cpp
Show First 20 Lines • Show All 162 Lines • ▼ Show 20 Line(s) | 137 | for (int i = 0; i < TEST_NEXT_PREV_SITUATION_COUNT; i++) { | |||
---|---|---|---|---|---|
163 | delete page; | 163 | delete page; | ||
164 | } | 164 | } | ||
165 | } | 165 | } | ||
166 | 166 | | |||
167 | void SearchTest::test311232() | 167 | void SearchTest::test311232() | ||
168 | { | 168 | { | ||
169 | Okular::Document d(nullptr); | 169 | Okular::Document d(nullptr); | ||
170 | SearchFinishedReceiver receiver; | 170 | SearchFinishedReceiver receiver; | ||
171 | QSignalSpy spy(&d, SIGNAL(searchFinished(int,Okular::Document::SearchStatus))); | 171 | QSignalSpy spy(&d, &Okular::Document::searchFinished); | ||
172 | 172 | | |||
173 | QObject::connect(&d, SIGNAL(searchFinished(int,Okular::Document::SearchStatus)), &receiver, SLOT(searchFinished(int,Okular::Document::SearchStatus))); | 173 | QObject::connect(&d, SIGNAL(searchFinished(int,Okular::Document::SearchStatus)), &receiver, SLOT(searchFinished(int,Okular::Document::SearchStatus))); | ||
174 | 174 | | |||
175 | const QString testFile = QStringLiteral(KDESRCDIR "data/file1.pdf"); | 175 | const QString testFile = QStringLiteral(KDESRCDIR "data/file1.pdf"); | ||
176 | QMimeDatabase db; | 176 | QMimeDatabase db; | ||
177 | const QMimeType mime = db.mimeTypeForFile( testFile ); | 177 | const QMimeType mime = db.mimeTypeForFile( testFile ); | ||
178 | d.openDocument(testFile, QUrl(), mime); | 178 | d.openDocument(testFile, QUrl(), mime); | ||
179 | 179 | | |||
▲ Show 20 Lines • Show All 58 Lines • ▼ Show 20 Line(s) | 235 | { | |||
238 | //QString::fromUtf8("İ").compare(QString::fromUtf8("İ").toLower(), Qt::CaseInsensitive) == FALSE, | 238 | //QString::fromUtf8("İ").compare(QString::fromUtf8("İ").toLower(), Qt::CaseInsensitive) == FALSE, | ||
239 | //at least in Qt 4.8). | 239 | //at least in Qt 4.8). | ||
240 | 240 | | |||
241 | //In the future it would be nice to add support for matching "İ"<->"i" and "I"<->"ı" in case-insensitive | 241 | //In the future it would be nice to add support for matching "İ"<->"i" and "I"<->"ı" in case-insensitive | ||
242 | //mode as well (QString::compare does not match them, at least in non-Turkish locales, since it follows | 242 | //mode as well (QString::compare does not match them, at least in non-Turkish locales, since it follows | ||
243 | //the Unicode case-folding rules http://www.unicode.org/Public/6.2.0/ucd/CaseFolding.txt). | 243 | //the Unicode case-folding rules http://www.unicode.org/Public/6.2.0/ucd/CaseFolding.txt). | ||
244 | 244 | | |||
245 | QVector<QString> text; | 245 | QVector<QString> text; | ||
246 | text << QString::fromUtf8("İ"); | 246 | text << QStringLiteral("İ"); | ||
247 | 247 | | |||
248 | QVector<Okular::NormalizedRect> rect; | 248 | QVector<Okular::NormalizedRect> rect; | ||
249 | rect << Okular::NormalizedRect(1, 2, 3, 4); | 249 | rect << Okular::NormalizedRect(1, 2, 3, 4); | ||
250 | 250 | | |||
251 | CREATE_PAGE; | 251 | CREATE_PAGE; | ||
252 | 252 | | |||
253 | Okular::RegularAreaRect* result = tp->findText(0, QString::fromUtf8("İ"), Okular::FromTop, Qt::CaseInsensitive, nullptr); | 253 | Okular::RegularAreaRect* result = tp->findText(0, QStringLiteral("İ"), Okular::FromTop, Qt::CaseInsensitive, nullptr); | ||
254 | QVERIFY(result); | 254 | QVERIFY(result); | ||
255 | delete result; | 255 | delete result; | ||
256 | 256 | | |||
257 | delete page; | 257 | delete page; | ||
258 | } | 258 | } | ||
259 | 259 | | |||
260 | void SearchTest::testHyphenAtEndOfLineWithoutYOverlap() | 260 | void SearchTest::testHyphenAtEndOfLineWithoutYOverlap() | ||
261 | { | 261 | { | ||
▲ Show 20 Lines • Show All 166 Lines • Show Last 20 Lines |