示例#1
0
int main(int argc, char** argv)
{
    KAboutData aboutData("kexicrash", 0, kxi18n("kexicrash"), "0.1");
    KCmdLineArgs::init(argc, argv, &aboutData);
    KApplication app;

    KDbDriverManager manager;
    KDbDriver* driver = manager.driver("sqlite3");
    KDbConnectionData cd;

    QString fname("d.kexi");
    cd.setFileName(fname);

    KDbConnection *connection = driver->createConnection(cd);
    connection->connect();
    connection->useDatabase(fname);

    KDbCursor *cursor = connection->executeQuery("select * from abc", KDbCursor::Buffered);
    //cursor->moveFirst();
    if (cursor) {
        cursor->moveNext();
        cursor->moveNext();
        cursor->moveNext();

        cursor->movePrev();
        cursor->moveNext(); // <---- Crashes here
    }
    return 0;
}
void KexiPasswordPage::setConnectionData(const KDbConnectionData &data)
{
    setPassword(data.savePassword() ? data.password() : QString());
    setUserName(data.userName());
    setServer(data.toUserVisibleString(KDbConnectionData::NoUserVisibleStringOption));
}
示例#3
0
KDB_EXPORT QDebug operator<<(QDebug dbg, const KDbConnectionData& data)
{
    dbg.nospace() << "CONNDATA";
    KDbDriverManager mananager;
    const KDbDriverMetaData *metaData = mananager.driverMetaData(data.driverId());
    dbg.nospace()
        << " databaseName=" << data.databaseName()
        << " caption=" << data.caption()
        << " description=" << data.description()
        << " driverId=" << data.driverId()
        << " userName="******" hostName=" << data.hostName()
        << " port=" << data.port()
        << " useLocalSocketFile=" << data.useLocalSocketFile()
        << " localSocketFileName=" << data.localSocketFileName()
        << " password="******"*").repeated(data.password().length()) /* security */
        << " savePassword="******" isPasswordNeeded=" <<
           qPrintable(metaData ? QString::number(data.isPasswordNeeded())
                     : QString::fromLatin1("[don't know, no valid driverId]"))
        << " userVisibleString=" << data.toUserVisibleString();
    return dbg.nospace();
}