int QDeclarativeFolderListModel::qt_metacall(QMetaObject::Call _c, int _id, void **_a) { _id = QAbstractListModel::qt_metacall(_c, _id, _a); if (_id < 0) return _id; if (_c == QMetaObject::InvokeMetaMethod) { if (_id < 6) qt_static_metacall(this, _c, _id, _a); _id -= 6; } #ifndef QT_NO_PROPERTIES else if (_c == QMetaObject::ReadProperty) { void *_v = _a[0]; switch (_id) { case 0: *reinterpret_cast< QUrl*>(_v) = folder(); break; case 1: *reinterpret_cast< QUrl*>(_v) = parentFolder(); break; case 2: *reinterpret_cast< QStringList*>(_v) = nameFilters(); break; case 3: *reinterpret_cast< SortField*>(_v) = sortField(); break; case 4: *reinterpret_cast< bool*>(_v) = sortReversed(); break; case 5: *reinterpret_cast< bool*>(_v) = showDirs(); break; case 6: *reinterpret_cast< bool*>(_v) = showDotAndDotDot(); break; case 7: *reinterpret_cast< bool*>(_v) = showOnlyReadable(); break; case 8: *reinterpret_cast< int*>(_v) = count(); break; } _id -= 9; } else if (_c == QMetaObject::WriteProperty) { void *_v = _a[0]; switch (_id) { case 0: setFolder(*reinterpret_cast< QUrl*>(_v)); break; case 2: setNameFilters(*reinterpret_cast< QStringList*>(_v)); break; case 3: setSortField(*reinterpret_cast< SortField*>(_v)); break; case 4: setSortReversed(*reinterpret_cast< bool*>(_v)); break; case 5: setShowDirs(*reinterpret_cast< bool*>(_v)); break; case 6: setShowDotAndDotDot(*reinterpret_cast< bool*>(_v)); break; case 7: setShowOnlyReadable(*reinterpret_cast< bool*>(_v)); break; } _id -= 9; } else if (_c == QMetaObject::ResetProperty) { _id -= 9; } else if (_c == QMetaObject::QueryPropertyDesignable) { _id -= 9; } else if (_c == QMetaObject::QueryPropertyScriptable) { _id -= 9; } else if (_c == QMetaObject::QueryPropertyStored) { _id -= 9; } else if (_c == QMetaObject::QueryPropertyEditable) { _id -= 9; } else if (_c == QMetaObject::QueryPropertyUser) { _id -= 9; } #endif // QT_NO_PROPERTIES return _id; }
// Parse cmd line args NoteStat::NoteStat(int argc,char **argv) : startTime_(0), endTime_(0), hours_(0), count_(false), tf_(UPDATE_FILE), sortField_(kFldSTime) { //cout << "DEBUG: Into NoteStat"; //cout << "DEBUG: NoteStat:: loaded tailfile pos = " << tf_.pos_ << endl; for(int c = 1; c < argc; c++) { char *ch = argv[c]; //cout << "\nDEBUG: cmd arg is " << ch << endl; if(*ch != '-') { usage(); string err = "Invalid command line args: "; throw err + argv[c];; } ch++; if(*ch != 'c' && *ch != 'C') { if(c == argc) { usage(); string err = "Invalid command line args: "; throw err + argv[c];; } } switch(*ch) { case 's': case 'S': ch = argv[++c]; if (!toEpoch(ch, &startTime_)) { usage(); throw string("Wrong time format in startTime"); } break; case 'e': case 'E': ch = argv[++c]; if (!toEpoch(ch, &endTime_)) { usage(); throw string("Wrong time format in endTime"); } break; case 'h': case 'H': ch = argv[++c]; hours_ = atoi(ch); break; case 'c': case 'C': count_ = true; break; case 'm': case 'M': while (((ch = argv[++c]) != NULL ) && *ch != '-') { module_.push_back(ch); } if((ch != NULL) && (*ch == '-')) { c--; } break; case 'o': case 'O': while ((ch = argv[++c]) != NULL && *ch != '-') { string status(ch); transform (status.begin(), status.end(), status.begin(), ::toupper); statusList_.push_back(status); } if((ch != NULL) && (*ch == '-')) { c--; } break; case 'u': case 'U': ch = argv[++c]; if (strchr(ch, '@')) { // List of email ids do { userList_.insert(ch); } while ((ch = argv[++c]) != NULL && *ch != '-'); if (ch != NULL && *ch == '-') { --c; } } else { // User file fillUserList(ch); } /* cout << "DEBUG: userList_ contents:" << endl; copy( userList_.begin(), userList_.end(), ostream_iterator<string>(cout, " ")); cout << endl; */ break; case 'g': case 'G': ch = argv[++c]; setSortField (ch); uicp_.reset (new UserInfoContainer(UserInfoSort(sortField_))); break; case 'f': case 'F': faultStr_ = argv[++c]; transform (faultStr_.begin(), faultStr_.end(), faultStr_.begin(), ::tolower); break; default: usage(); string err = "Invalid command line args: "; throw err + argv[c]; } } // end for if (startTime_ == 0 && hours_ == 0) { usage(); throw string("Invalid command line args: startTime missing"); } else if (startTime_ != 0 && hours_ != 0) { usage(); throw string("Invalid command line args: Cannot specify hours along with startTime"); } else if (startTime_ == 0 && hours_ != 0) { if (endTime_ == 0) { time_t now; time (&now); if (now == -1) { throw string("Cannot find current time: system has no time"); } endTime_ = now; } // set proper start time struct tm t; localtime_r (&endTime_, &t); t.tm_isdst = -1; // subtract the hours from end time t.tm_hour -= hours_; startTime_ = mktime (&t); } }
CSort::CSort(CSortFields* pSortFields) : m_pSortFields(NULL) { setSortField(pSortFields); }
// Parse cmd line args NoteStat::NoteStat(int argc,char **argv) : startTime_(0), endTime_(0), hours_(0), count_(false), tf_(UPDATE_FILE), sortField_(kFldSTime) { //cout << "DEBUG: Into NoteStat"; //cout << "DEBUG: NoteStat:: loaded tailfile pos = " << tf_.pos_ << endl; for(int c = 1; c < argc; c++) { char *ch = argv[c]; //cout << "\nDEBUG: cmd arg is " << ch << endl; if(*ch != '-') { usage(); string err = "Invalid command line args: "; throw err + argv[c];; } ch++; if(*ch != 'c' && *ch != 'C') { if(c == argc) { usage(); string err = "Invalid command line args: "; throw err + argv[c];; } } switch(*ch) { case 's': case 'S': ch = argv[++c]; startTime_ = atol(ch); break; case 'e': case 'E': ch = argv[++c]; endTime_ = atol(ch); break; case 'h': case 'H': ch = argv[++c]; hours_ = atoi(ch); break; case 'c': case 'C': count_ = true; break; case 'm': case 'M': while (((ch = argv[++c]) != NULL ) && *ch != '-') { module_.push_back(ch); } if((ch != NULL) && (*ch == '-')) { c--; } break; case 'o': case 'O': while ((ch = argv[++c]) != NULL && *ch != '-') { string status(ch); transform (status.begin(), status.end(), status.begin(), ::toupper); statusList_.push_back(status); } if((ch != NULL) && (*ch == '-')) { c--; } break; case 'u': case 'U': ch = argv[++c]; if (strchr(ch, '@')) { // List of email ids do { userList_.insert(ch); } while ((ch = argv[++c]) != NULL && *ch != '-'); if (ch != NULL && *ch == '-') { --c; } } else { // User file fillUserList(ch); } /* cout << "DEBUG: userList_ contents:" << endl; copy( userList_.begin(), userList_.end(), ostream_iterator<string>(cout, " ")); cout << endl; */ break; case 'g': case 'G': ch = argv[++c]; setSortField(ch); uicp_.reset(new UserInfoContainer(UserInfoSort(sortField_))); break; case 'f': case 'F': faultStr_ = argv[++c]; transform (faultStr_.begin(), faultStr_.end(), faultStr_.begin(), ::tolower); break; default: usage(); string err = "Invalid command line args: "; throw err + argv[c]; } } // end for if(startTime_ == 0) { string err("Invalid command line args: "); if (endTime_ == 0 && hours_ == 0) { err += "startTime missing"; } else if (endTime_ == 0 || hours_ == 0) { err += "endTime or hours is missing"; } usage(); throw err; } else { if (hours_ != 0) { string err("Cannot specify hours along with startTime"); usage(); throw err; } } }
CSort::CSort(CSortField* pSortField) : m_pSortFields(NULL) { setSortField(pSortField); }
CSort::CSort(const tchar** field,bool* bReverses,int32_t nNumFields) : m_pSortFields(NULL) { setSortField(field,bReverses,nNumFields); }
CSort::CSort(const tchar** field,int32_t nNumFields) : m_pSortFields(NULL) { setSortField(field,nNumFields); }
CSort::CSort(const tchar* field,bool reverse) : m_pSortFields(NULL) { setSortField(field,reverse); }
int QDeclarativeFolderListModel::qt_metacall(QMetaObject::Call _c, int _id, void **_a) { _id = QAbstractListModel::qt_metacall(_c, _id, _a); if (_id < 0) return _id; if (_c == QMetaObject::InvokeMetaMethod) { switch (_id) { case 0: folderChanged(); break; case 1: countChanged(); break; case 2: refresh(); break; case 3: inserted((*reinterpret_cast< const QModelIndex(*)>(_a[1])),(*reinterpret_cast< int(*)>(_a[2])),(*reinterpret_cast< int(*)>(_a[3]))); break; case 4: removed((*reinterpret_cast< const QModelIndex(*)>(_a[1])),(*reinterpret_cast< int(*)>(_a[2])),(*reinterpret_cast< int(*)>(_a[3]))); break; case 5: handleDataChanged((*reinterpret_cast< const QModelIndex(*)>(_a[1])),(*reinterpret_cast< const QModelIndex(*)>(_a[2]))); break; case 6: { bool _r = isFolder((*reinterpret_cast< int(*)>(_a[1]))); if (_a[0]) *reinterpret_cast< bool*>(_a[0]) = _r; } break; default: ; } _id -= 7; } #ifndef QT_NO_PROPERTIES else if (_c == QMetaObject::ReadProperty) { void *_v = _a[0]; switch (_id) { case 0: *reinterpret_cast< QUrl*>(_v) = folder(); break; case 1: *reinterpret_cast< QUrl*>(_v) = parentFolder(); break; case 2: *reinterpret_cast< QStringList*>(_v) = nameFilters(); break; case 3: *reinterpret_cast< SortField*>(_v) = sortField(); break; case 4: *reinterpret_cast< bool*>(_v) = sortReversed(); break; case 5: *reinterpret_cast< bool*>(_v) = showDirs(); break; case 6: *reinterpret_cast< bool*>(_v) = showDotAndDotDot(); break; case 7: *reinterpret_cast< bool*>(_v) = showOnlyReadable(); break; case 8: *reinterpret_cast< int*>(_v) = count(); break; } _id -= 9; } else if (_c == QMetaObject::WriteProperty) { void *_v = _a[0]; switch (_id) { case 0: setFolder(*reinterpret_cast< QUrl*>(_v)); break; case 2: setNameFilters(*reinterpret_cast< QStringList*>(_v)); break; case 3: setSortField(*reinterpret_cast< SortField*>(_v)); break; case 4: setSortReversed(*reinterpret_cast< bool*>(_v)); break; case 5: setShowDirs(*reinterpret_cast< bool*>(_v)); break; case 6: setShowDotAndDotDot(*reinterpret_cast< bool*>(_v)); break; case 7: setShowOnlyReadable(*reinterpret_cast< bool*>(_v)); break; } _id -= 9; } else if (_c == QMetaObject::ResetProperty) { _id -= 9; } else if (_c == QMetaObject::QueryPropertyDesignable) { _id -= 9; } else if (_c == QMetaObject::QueryPropertyScriptable) { _id -= 9; } else if (_c == QMetaObject::QueryPropertyStored) { _id -= 9; } else if (_c == QMetaObject::QueryPropertyEditable) { _id -= 9; } else if (_c == QMetaObject::QueryPropertyUser) { _id -= 9; } #endif // QT_NO_PROPERTIES return _id; }