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