Changeset View
Changeset View
Standalone View
Standalone View
kexi/core/kexi.h
Show First 20 Lines • Show All 104 Lines • ▼ Show 20 Line(s) | 100 | public: | |||
---|---|---|---|---|---|
105 | ObjectStatus(KexiDB::Object* dbObject, const QString& message, const QString& description); | 105 | ObjectStatus(KexiDB::Object* dbObject, const QString& message, const QString& description); | ||
106 | 106 | | |||
107 | ~ObjectStatus(); | 107 | ~ObjectStatus(); | ||
108 | 108 | | |||
109 | const ObjectStatus& status() const; | 109 | const ObjectStatus& status() const; | ||
110 | 110 | | |||
111 | bool error() const; | 111 | bool error() const; | ||
112 | 112 | | |||
113 | void setStatus(const QString& message, const QString& description); | 113 | void setStatus(const QString& message, const QString& description, | ||
114 | const QString& errorSql = QString()); | ||||
114 | 115 | | |||
115 | //! Note: for safety, \a dbObject needs to be derived from QObject, | 116 | //! Note: for safety, \a dbObject needs to be derived from QObject, | ||
116 | //! otherwise it won't be assigned | 117 | //! otherwise it won't be assigned | ||
117 | void setStatus(KexiDB::Object* dbObject, | 118 | void setStatus(KexiDB::Object* dbObject, | ||
118 | const QString& message = QString(), const QString& description = QString()); | 119 | const QString& message = QString(), const QString& description = QString()); | ||
119 | 120 | | |||
120 | void setStatus(KexiDB::ResultInfo* result, | 121 | void setStatus(KexiDB::ResultInfo* result, | ||
121 | const QString& message = QString(), const QString& description = QString()); | 122 | const QString& message = QString(), const QString& description = QString()); | ||
Show All 10 Lines | |||||
132 | KexiDB::Object *dbObject() const { | 133 | KexiDB::Object *dbObject() const { | ||
133 | return dynamic_cast<KexiDB::Object*>((QObject*)dbObj); | 134 | return dynamic_cast<KexiDB::Object*>((QObject*)dbObj); | ||
134 | } | 135 | } | ||
135 | 136 | | |||
136 | //! Helper returning pseudo handler that just updates this ObjectStatus object | 137 | //! Helper returning pseudo handler that just updates this ObjectStatus object | ||
137 | //! by receiving a message | 138 | //! by receiving a message | ||
138 | operator KexiDB::MessageHandler*(); | 139 | operator KexiDB::MessageHandler*(); | ||
139 | 140 | | |||
140 | QString message, description; | 141 | QString message; | ||
142 | QString description; | ||||
143 | QString errorSql; //!< Recently executed SQL, overrides information from dbObject() | ||||
141 | protected: | 144 | protected: | ||
142 | QPointer<QObject> dbObj; //! This is in fact KexiDB::Object | 145 | QPointer<QObject> dbObj; //! This is in fact KexiDB::Object | ||
143 | KexiDB::MessageHandler* msgHandler; | 146 | KexiDB::MessageHandler* msgHandler; | ||
144 | }; | 147 | }; | ||
145 | 148 | | |||
146 | /*! \return icon name for default file-based driver | 149 | /*! \return icon name for default file-based driver | ||
147 | (typically icon for something like "application/x-kexiproject-sqlite"). | 150 | (typically icon for something like "application/x-kexiproject-sqlite"). | ||
148 | @see KexiDB::defaultFileBasedDriverMimeType() */ | 151 | @see KexiDB::defaultFileBasedDriverMimeType() */ | ||
Show All 39 Lines |