int ONVIF::Users::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 < 3) qt_static_metacall(this, _c, _id, _a); _id -= 3; } else if (_c == QMetaObject::RegisterMethodArgumentMetaType) { if (_id < 3) *reinterpret_cast<int*>(_a[0]) = -1; _id -= 3; } #ifndef QT_NO_PROPERTIES else if (_c == QMetaObject::ReadProperty) { void *_v = _a[0]; switch (_id) { case 0: *reinterpret_cast< QString*>(_v) = userName(); break; case 1: *reinterpret_cast< QString*>(_v) = passWord(); break; case 2: *reinterpret_cast< UserLevelType*>(_v) = userLevel(); break; default: break; } _id -= 3; } else if (_c == QMetaObject::WriteProperty) { void *_v = _a[0]; switch (_id) { case 0: setUserName(*reinterpret_cast< QString*>(_v)); break; case 1: setPassWord(*reinterpret_cast< QString*>(_v)); break; case 2: setUserLevel(*reinterpret_cast< UserLevelType*>(_v)); break; default: break; } _id -= 3; } else if (_c == QMetaObject::ResetProperty) { _id -= 3; } else if (_c == QMetaObject::QueryPropertyDesignable) { _id -= 3; } else if (_c == QMetaObject::QueryPropertyScriptable) { _id -= 3; } else if (_c == QMetaObject::QueryPropertyStored) { _id -= 3; } else if (_c == QMetaObject::QueryPropertyEditable) { _id -= 3; } else if (_c == QMetaObject::QueryPropertyUser) { _id -= 3; } else if (_c == QMetaObject::RegisterPropertyMetaType) { if (_id < 3) *reinterpret_cast<int*>(_a[0]) = -1; _id -= 3; } #endif // QT_NO_PROPERTIES return _id; }
// A save or restore has been requested (Probably by QEGui itself) void saveRestoreManager::saveRestore( SaveRestoreSignal::saveRestoreOptions option ) { PersistanceManager* pm = profile.getPersistanceManager(); switch( option ) { // Save the application data case SaveRestoreSignal::SAVE: { // Start with the top level element - the QEGui application PMElement appElement = pm->addNamedConfiguration( SAVERESTORE_NAME ); // Note the number of main windows. This will determine how many main windows are expected on restore appElement.addValue( "MainWindows", app->getMainWindowCount() ); // Note the current user level userLevelTypes meta; appElement.addValue ("UserLevel", QEUtilities::enumToString( meta, "userLevels", getUserLevel() )); } break; // First restore phase. // This application will create the main windows and the GUIs they contain case SaveRestoreSignal::RESTORE_APPLICATION: { // Get the data for this application PMElement QEGuiData = pm->getNamedConfiguration( SAVERESTORE_NAME ); // If none, do nothing if( QEGuiData.isNull() ) { return; } // Note the current user level QString levelString; QEGuiData.getValue( "UserLevel", levelString ); userLevelTypes meta; userLevelTypes::userLevels levelInt; bool ok; levelInt = (userLevelTypes::userLevels)QEUtilities::stringToEnum( meta, "userLevels", levelString, &ok ); if( ok ) { setUserLevel( levelInt ); } // Get the number of expected main windows int numMainWindows = 0; QEGuiData.getValue( "MainWindows", numMainWindows ); // Create the main windows. They will restore themselves setupProfile( NULL, app->getParams()->pathList, "", app->getParams()->substitutions ); for( int i = 0; i < numMainWindows; i++ ) { MainWindow* mw = new MainWindow( app, "", "", "", QEFormMapper::nullHandle(), false ); mw->show(); } releaseProfile(); } break; // Second resore phase. // This application has done it's work. The widgets that have been created will be able to act on the second phase case SaveRestoreSignal::RESTORE_QEFRAMEWORK: break; } }