| 50 | } |
| 51 | |
| 52 | bool |
| 53 | Monitor::MonitorData::setRepoIor( const QString& ior) |
| 54 | { |
| 55 | if( !this->enabled_) { |
| 56 | return false; |
| 57 | } |
| 58 | |
| 59 | // Replace call to toStdString() with toLocal8Bit().constData() |
| 60 | // to avoid QString-related aborts under windows. |
| 61 | QByteArray ior_arr = ior.toLocal8Bit(); |
| 62 | const char* ior_str = ior_arr.constData(); |
| 63 | |
| 64 | // Return successfully if the requested repository is already the |
| 65 | // active repository. |
| 66 | if( this->storage_->activeIor() == ior_str) { |
| 67 | return true; |
| 68 | } |
| 69 | |
| 70 | // Set the repository IOR. |
| 71 | MonitorTask::RepoKey key |
| 72 | = this->dataSource_->setRepoIor( ior_str); |
| 73 | |
| 74 | // Clear existing data. |
| 75 | this->clearData(); |
| 76 | |
| 77 | // Switch to the new repository. |
| 78 | if( this->dataSource_->setActiveRepo( key)) { |
| 79 | this->storage_->activeIor() = ior_str; |
| 80 | return true; |
| 81 | |
| 82 | } else { |
| 83 | return false; |
| 84 | } |
| 85 | } |
| 86 | |
| 87 | bool |
| 88 | Monitor::MonitorData::removeRepo( const QString& ior) |
nothing calls this directly
no test coverage detected