m_edit = true;
}
+int MyListAddCommand::aid() const
+{
+ return m_aid;
+}
+
+void MyListAddCommand::setAid(int aid)
+{
+ m_aid = aid;
+}
+
+int MyListAddCommand::epno() const
+{
+ return m_epno;
+}
+
+void MyListAddCommand::setEpno(int epno)
+{
+ m_epno = epno;
+}
+
+int MyListAddCommand::epmin() const
+{
+ return m_epmin;
+}
+
+void MyListAddCommand::setEpmin(int epmin)
+{
+ m_epmin = epmin;
+}
+
+QString MyListAddCommand::eptype() const
+{
+ return m_eptype;
+}
+
+void MyListAddCommand::setEptype(const QString &eptype)
+{
+ m_eptype = eptype;
+}
+
int MyListAddCommand::fid() const
{
return m_fid;
bool MyListAddCommand::isValid() const
{
- return m_fid || (!m_ed2k.isEmpty() && m_size) || (m_lid && m_edit);
+ return m_fid || (!m_ed2k.isEmpty() && m_size) || (m_lid && m_edit) || (m_aid && m_edit);
}
Command MyListAddCommand::rawCommand() const
cmd.first = "MYLISTADD";
- if (m_fid)
+ if (m_edit && m_aid)
+ {
+ cmd.second["aid"] = m_aid;
+ cmd.second["epno"] = m_eptype + QString::number(m_epno);
+ if (m_epmin)
+ cmd.second["epmin"] = m_eptype + QString::number(m_epmin);
+ }
+ else if (m_edit && m_lid)
+ {
+ cmd.second["lid"] = m_lid;
+ }
+ else if (m_fid)
{
cmd.second["fid"] = m_fid;
}
cmd.second["ed2k"] = m_ed2k;
cmd.second["size"] = m_size;
}
- else if (m_lid)
- {
- cmd.second["lid"] = m_lid;
- }
if (m_edit)
{
void MyListAddCommand::init()
{
+ m_aid = 0;
+ m_epno = 0;
+ m_epmin = 0;
+ m_eptype = "";
+
m_fid = 0;
m_lid = 0;
MyListAddCommand(const QByteArray &ed2k, qint64 size, bool edit);
explicit MyListAddCommand(int lid);
+ int aid() const;
+ void setAid(int aid);
+
+ int epno() const;
+ void setEpno(int epno);
+
+ int epmin() const;
+ void setEpmin(int epmin);
+
+ QString eptype() const;
+ void setEptype(const QString &eptype);
+
int fid() const;
void setFid(int fid);
private:
void init();
+ int m_aid;
+ int m_epno;
+ int m_epmin;
+ QString m_eptype;
+
int m_fid;
int m_lid;