mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-08-05 21:04:14 -04:00
CreateForumMsg:
- removed memory leak in context menu - cleaned includes git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@3295 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
0ab77d8a40
commit
de57423733
2 changed files with 122 additions and 136 deletions
|
@ -21,19 +21,22 @@
|
|||
|
||||
#include "CreateForumMsg.h"
|
||||
|
||||
#include <gui/settings/rsharesettings.h>
|
||||
#include <QMenu>
|
||||
#include <QMessageBox>
|
||||
#include <QFile>
|
||||
#include <QFileDialog>
|
||||
#include <QDesktopWidget>
|
||||
#include <QDropEvent>
|
||||
|
||||
#include <gui/RetroShareLink.h>
|
||||
#include <QtGui>
|
||||
|
||||
#include "rsiface/rsforums.h"
|
||||
#include "rsiface/rsfiles.h"
|
||||
|
||||
#include <sys/stat.h>
|
||||
|
||||
#include "gui/settings/rsharesettings.h"
|
||||
#include "gui/RetroShareLink.h"
|
||||
#include "gui/feeds/AttachFileItem.h"
|
||||
|
||||
#include <sstream>
|
||||
#include <sys/stat.h>
|
||||
|
||||
|
||||
/** Constructor */
|
||||
|
@ -55,34 +58,31 @@ CreateForumMsg::CreateForumMsg(std::string fId, std::string pId)
|
|||
connect( ui.attachFileButton, SIGNAL(clicked() ), this , SLOT(addFile()));
|
||||
connect( ui.pastersButton, SIGNAL(clicked() ), this , SLOT(pasteLink()));
|
||||
|
||||
|
||||
|
||||
newMsg();
|
||||
|
||||
loadEmoticonsForums();
|
||||
|
||||
}
|
||||
|
||||
/** context menu searchTablewidget2 **/
|
||||
void CreateForumMsg::forumMessageCostumPopupMenu( QPoint point )
|
||||
{
|
||||
QMenu contextMnu (this);
|
||||
|
||||
if(RSLinkClipboard::empty())
|
||||
return ;
|
||||
QAction *pasteLinkAct = new QAction(QIcon(":/images/pasterslink.png"), tr( "Paste retroshare Link" ), &contextMnu );
|
||||
QAction *pasteLinkFullAct = new QAction(QIcon(":/images/pasterslink.png"), tr( "Paste retroshare Link Full" ), &contextMnu );
|
||||
|
||||
contextMnu = new QMenu( this );
|
||||
if (RSLinkClipboard::empty()) {
|
||||
pasteLinkAct->setDisabled (true);
|
||||
pasteLinkFullAct->setDisabled (true);
|
||||
} else {
|
||||
connect(pasteLinkAct , SIGNAL(triggered()), this, SLOT(pasteLink()));
|
||||
connect(pasteLinkFullAct , SIGNAL(triggered()), this, SLOT(pasteLinkFull()));
|
||||
}
|
||||
|
||||
pasteLinkAct = new QAction(QIcon(":/images/pasterslink.png"), tr( "Paste retroshare Link" ), this );
|
||||
connect( pasteLinkAct , SIGNAL( triggered() ), this, SLOT( pasteLink() ) );
|
||||
contextMnu.addAction(pasteLinkAct);
|
||||
contextMnu.addAction(pasteLinkFullAct);
|
||||
|
||||
pasteLinkFullAct = new QAction(QIcon(":/images/pasterslink.png"), tr( "Paste retroshare Link Full" ), this );
|
||||
connect( pasteLinkFullAct , SIGNAL( triggered() ), this, SLOT( pasteLinkFull() ) );
|
||||
|
||||
contextMnu->clear();
|
||||
contextMnu->addAction( pasteLinkAct);
|
||||
contextMnu->addAction( pasteLinkFullAct);
|
||||
|
||||
contextMnu->exec(QCursor::pos());
|
||||
contextMnu.exec(QCursor::pos());
|
||||
}
|
||||
|
||||
|
||||
|
@ -96,8 +96,7 @@ void CreateForumMsg::newMsg()
|
|||
|
||||
QString name = QString::fromStdWString(fi.forumName);
|
||||
QString subj;
|
||||
if ((mParentId != "") && (rsForums->getForumMessage(
|
||||
mForumId, mParentId, msg)))
|
||||
if ((mParentId != "") && (rsForums->getForumMessage(mForumId, mParentId, msg)))
|
||||
{
|
||||
name += " In Reply to: ";
|
||||
name += QString::fromStdWString(msg.title);
|
||||
|
@ -154,7 +153,6 @@ void CreateForumMsg::createMsg()
|
|||
return; //Don't add a empty Subject!!
|
||||
}
|
||||
|
||||
|
||||
ForumMsgInfo msgInfo;
|
||||
|
||||
msgInfo.forumId = mForumId;
|
||||
|
@ -171,7 +169,6 @@ void CreateForumMsg::createMsg()
|
|||
msgInfo.msgflags = RS_DISTRIB_AUTHEN_REQ;
|
||||
}
|
||||
|
||||
|
||||
if ((msgInfo.msg == L"") && (msgInfo.title == L""))
|
||||
return; /* do nothing */
|
||||
|
||||
|
|
|
@ -23,14 +23,10 @@
|
|||
#ifndef _CREATE_FORUM_MSG_DIALOG_H
|
||||
#define _CREATE_FORUM_MSG_DIALOG_H
|
||||
|
||||
#include <QtGui>
|
||||
#include <QWidget>
|
||||
#include <string>
|
||||
|
||||
#include "gui/feeds/AttachFileItem.h"
|
||||
|
||||
#include "ui_CreateForumMsg.h"
|
||||
|
||||
class AttachFileItem;
|
||||
|
||||
class CreateForumMsg : public QMainWindow
|
||||
{
|
||||
Q_OBJECT
|
||||
|
@ -65,13 +61,6 @@ protected:
|
|||
|
||||
|
||||
private:
|
||||
/** Define the popup menus for the Context menu */
|
||||
QMenu* contextMnu;
|
||||
|
||||
/** Defines the actions for the context menu */
|
||||
QAction* pasteLinkAct;
|
||||
QAction* pasteLinkFullAct;
|
||||
|
||||
std::string mForumId;
|
||||
std::string mParentId;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue