fixed two crashes, enabled not qt tray icon in pantheon env

This commit is contained in:
John Preston 2015-07-24 10:37:17 +02:00
parent f0c580db2d
commit 5fe1b7b51f
3 changed files with 4 additions and 2 deletions

View File

@ -1029,6 +1029,8 @@ QString HistoryList::getSelectedText() const {
QMap<int32, QString> texts;
for (SelectedItems::const_iterator i = sel.cbegin(), e = sel.cend(); i != e; ++i) {
HistoryItem *item = i.key();
if (item->detached()) continue;
QString text, sel = item->selectedText(FullItemSel), time = item->date.toString(timeFormat);
int32 size = item->from()->name.size() + time.size() + sel.size();
text.reserve(size);

View File

@ -315,7 +315,7 @@ void MediaView::updateDropdown() {
_btnSaveAs->setVisible(true);
_btnCopy->setVisible((_doc && !_current.isNull()) || (_photo && _photo->full->loaded()));
_btnForward->setVisible(_msgid > 0);
_btnDelete->setVisible(_msgid > 0 || (App::self() && App::self()->photoId == _photo->id) || (_photo->chat && _photo->chat->photoId == _photo->id));
_btnDelete->setVisible(_msgid > 0 || (_photo && App::self() && App::self()->photoId == _photo->id) || (_photo && _photo->chat && _photo->chat->photoId == _photo->id));
_btnViewAll->setVisible((_overview != OverviewCount) && _history);
_btnViewAll->setText(lang(_doc ? lng_mediaview_files_all : lng_mediaview_photos_all));
_dropdown.updateButtons();

View File

@ -356,7 +356,7 @@ namespace {
inited = true;
QString cdesktop = QString(getenv("XDG_CURRENT_DESKTOP")).toLower();
noQtTrayIcon = false;//(cdesktop == qstr("pantheon")) || (cdesktop == qstr("gnome"));
noQtTrayIcon = (cdesktop == qstr("pantheon"));// || (cdesktop == qstr("gnome"));
noTryUnity = (cdesktop != qstr("unity"));
if (noQtTrayIcon) cSetSupportTray(false);