Tries to find a session identified by @p data in @p sessions. The @p data may be either a session's name or a string-representation of its UUID. @return pointer to the session or NULL if nothing appropriate has been found
| 177 | /// The @p data may be either a session's name or a string-representation of its UUID. |
| 178 | /// @return pointer to the session or NULL if nothing appropriate has been found |
| 179 | static const KDevelop::SessionInfo* findSessionInList( const SessionInfos& sessions, const QString& data ) |
| 180 | { |
| 181 | // We won't search a session without input data, since that could lead to false-positives |
| 182 | // with unnamed sessions |
| 183 | if( data.isEmpty() ) |
| 184 | return nullptr; |
| 185 | |
| 186 | for( auto it = sessions.constBegin(); it != sessions.constEnd(); ++it ) { |
| 187 | if ( ( it->name == data ) || ( it->uuid.toString() == data ) ) { |
| 188 | const KDevelop::SessionInfo& sessionRef = *it; |
| 189 | return &sessionRef; |
| 190 | } |
| 191 | } |
| 192 | return nullptr; |
| 193 | } |
| 194 | |
| 195 | /// Tries to find sessions containing project @p projectUrl in @p sessions. |
| 196 | static const KDevelop::SessionInfos findSessionsWithProject(const SessionInfos& sessions, const QUrl& projectUrl) |
no test coverage detected