int Cordova::qt_metacall(QMetaObject::Call _c, int _id, void **_a) { _id = QObject::qt_metacall(_c, _id, _a); if (_id < 0) return _id; if (_c == QMetaObject::InvokeMetaMethod) { if (_id < 8) qt_static_metacall(this, _c, _id, _a); _id -= 8; } else if (_c == QMetaObject::RegisterMethodArgumentMetaType) { if (_id < 8) *reinterpret_cast<int*>(_a[0]) = -1; _id -= 8; } #ifndef QT_NO_PROPERTIES else if (_c == QMetaObject::ReadProperty) { void *_v = _a[0]; switch (_id) { case 0: *reinterpret_cast< QString*>(_v) = mainUrl(); break; default: break; } _id -= 1; } else if (_c == QMetaObject::WriteProperty) { _id -= 1; } else if (_c == QMetaObject::ResetProperty) { _id -= 1; } else if (_c == QMetaObject::QueryPropertyDesignable) { _id -= 1; } else if (_c == QMetaObject::QueryPropertyScriptable) { _id -= 1; } else if (_c == QMetaObject::QueryPropertyStored) { _id -= 1; } else if (_c == QMetaObject::QueryPropertyEditable) { _id -= 1; } else if (_c == QMetaObject::QueryPropertyUser) { _id -= 1; } else if (_c == QMetaObject::RegisterPropertyMetaType) { if (_id < 1) *reinterpret_cast<int*>(_a[0]) = -1; _id -= 1; } #endif // QT_NO_PROPERTIES return _id; }
QList<ZealSearchResult> ZealDocsetsRegistry::getRelatedLinks(QString name, QString path) { QList<ZealSearchResult> results; // Get the url without the #anchor. QUrl mainUrl(path); mainUrl.setFragment(NULL); QString pageUrl(mainUrl.toString()); docsetEntry entry = docs[name]; // Prepare the query to look up all pages with the same url. QString query; if (entry.type == DASH) { query = QString("SELECT name, type, path FROM searchIndex WHERE path LIKE \"%1%%\"").arg(pageUrl); } else if (entry.type == ZDASH) { query = QString("SELECT ztoken.ztokenname, ztokentype.ztypename, zfilepath.zpath, ztokenmetainformation.zanchor " "FROM ztoken " "JOIN ztokenmetainformation ON ztoken.zmetainformation = ztokenmetainformation.z_pk " "JOIN zfilepath ON ztokenmetainformation.zfile = zfilepath.z_pk " "JOIN ztokentype ON ztoken.ztokentype = ztokentype.z_pk " "WHERE zfilepath.zpath = \"%1\"").arg(pageUrl); } else if (entry.type == ZEAL) { query = QString("SELECT name type, path FROM things WHERE path LIKE \"%1%%\"").arg(pageUrl); } QSqlQuery result = entry.db.exec(query); while (result.next()) { QString sectionName = result.value(0).toString(); QString sectionPath = result.value(2).toString(); QString parentName; if (entry.type == ZDASH) { sectionPath.append("#"); sectionPath.append(result.value(3).toString()); } normalizeName(sectionName, parentName, ""); results.append(ZealSearchResult(sectionName, "", sectionPath, name, QString())); } return results; }