Fix regression in frequencies to stations drag & drop

Since mode  dependent frequencies  were added the  MIME type  for drag
from the FrequenciesList model has been broken. This change fixes that
and  adapts the  StationList model  to  accept the  amended MIME  data
drops.

git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@6096 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
This commit is contained in:
Bill Somerville 2015-11-13 23:44:48 +00:00
parent c51f8da785
commit be9dd309d6
2 changed files with 5 additions and 5 deletions

View File

@ -551,7 +551,7 @@ QMimeData * FrequencyList::impl::mimeData (QModelIndexList const& items) const
{
if (item.isValid () && frequency_column == item.column ())
{
stream << QString {data (item, Qt::DisplayRole).toString ()};
stream << frequency_list_.at (item.row ());
}
}

View File

@ -18,6 +18,7 @@
#include "pimpl_impl.hpp"
#include "Bands.hpp"
#include "FrequencyList.hpp"
#if !defined (QT_NO_DEBUG_STREAM)
QDebug operator << (QDebug debug, StationList::Station const& station)
@ -508,10 +509,9 @@ bool StationList::impl::dropMimeData (QMimeData const * data, Qt::DropAction act
QDataStream stream {&encoded_data, QIODevice::ReadOnly};
while (!stream.atEnd ())
{
QString frequency_string;
stream >> frequency_string;
auto frequency = Radio::frequency (frequency_string, 0);
auto const& band = bands_->find (frequency);
FrequencyList::Item item;
stream >> item;
auto const& band = bands_->find (item.frequency_);
if (stations_.cend () == std::find_if (stations_.cbegin ()
, stations_.cend ()
, [&band] (Station const& s) {return s.band_name_ == band;}))