Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void IrcAccountConfigurationDialog::DeleteElement (const QString& key, const QModelIndex& index, const QString& message)
- {
- int ret = QMessageBox::warning (this, "LeechCraft",
- message,
- QMessageBox::Ok | QMessageBox::Cancel,
- QMessageBox::Cancel);
- if (ret == QMessageBox::Ok)
- for (int i = ServersInfo_.count () - 1; i >= 0; --i)
- {
- if (key == "Channels")
- {
- for (int j = ServersInfo_.count () - 1; j >= 0; --j)
- {
- if (ServersInfo_.at (j).toMap () ["Name"] == index.parent ().data () &&
- ServersInfo_.at (j).toMap () ["Network"] == index.parent ().parent ().data ())
- {
- QStringList list = ServersInfo_.at (j).toMap () ["Channels"].toStringList ();
- for (int k = list.count () - 1; k >= 0; --k)
- {
- QString str = list.at (k);
- if (str.split (' ').at (0) == index.data ().toString ())
- list.removeAt (k);
- }
- QMap<QString, QVariant> map = ServersInfo_.at (j).toMap ();
- map ["Channels"] = QStringList () + list;
- ServersInfo_ [j] = map;
- }
- }
- }
- else if (ServersInfo_.at (i).toMap () [key].toString () == index.data ().toString ())
- ServersInfo_.removeAt (i);
- }
- SetServersInfo (ServersInfo_);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement