forked from qt-creator/qt-creator
Maemo: Polish class interface.
This commit is contained in:
@@ -139,14 +139,14 @@ private:
|
||||
{
|
||||
const int startPort = parsePort();
|
||||
if (atEnd() || nextChar() != '-') {
|
||||
m_portList.addRange(MaemoPortList::Range(startPort, startPort));
|
||||
m_portList.addPort(startPort);
|
||||
return;
|
||||
}
|
||||
++m_pos;
|
||||
const int endPort = parsePort();
|
||||
if (endPort < startPort)
|
||||
throw ParseException("Invalid range (end < start).");
|
||||
m_portList.addRange(MaemoPortList::Range(startPort, endPort));
|
||||
m_portList.addRange(startPort, endPort);
|
||||
}
|
||||
|
||||
int parsePort()
|
||||
|
@@ -51,9 +51,12 @@ namespace Internal {
|
||||
|
||||
class MaemoPortList
|
||||
{
|
||||
public:
|
||||
typedef QPair<int, int> Range;
|
||||
void addRange(const Range &range) { m_ranges << range; }
|
||||
public:
|
||||
void addPort(int port) { addRange(port, port); }
|
||||
void addRange(int startPort, int endPort) {
|
||||
m_ranges << Range(startPort, endPort);
|
||||
}
|
||||
bool hasMore() const { return !m_ranges.isEmpty(); }
|
||||
int count() const {
|
||||
int n = 0;
|
||||
|
Reference in New Issue
Block a user