Beispiel #1
0
int CurlFtp::customCommandWithoutResponseText(QString cmdLine, long &respCode)
{
    int rc = customCommand(cmdLine, respCode);
    Q_ASSERT(!this->rawRespBuff.isOpen());    
    this->rawRespBuff.setData(NULL, 0);
    return rc;
}
MessageView::MessageView(MessageView::ViewType type, Session* session, QWidget* parent) :
    QWidget(parent)
{
    d.setupUi(this);
    d.viewType = type;

    d.topicLabel->setMinimumHeight(d.lineEditor->sizeHint().height());
    d.helpLabel->setMinimumHeight(d.lineEditor->sizeHint().height());

    connect(d.splitter, SIGNAL(splitterMoved(int,int)), this, SLOT(onSplitterMoved()));

    setFocusProxy(d.lineEditor);
    d.textBrowser->setBuddy(d.lineEditor);

    d.formatter.setHighlights(QStringList(session->nickName()));
    d.formatter.setMessageFormat("class='message'");
    d.formatter.setEventFormat("class='event'");
    d.formatter.setNoticeFormat("class='notice'");
    d.formatter.setActionFormat("class='action'");
    d.formatter.setUnknownFormat("class='unknown'");
    d.formatter.setHighlightFormat("class='highlight'");
    d.formatter.setTimeStampFormat("class='timestamp'");

    d.session = session;
    connect(&d.parser, SIGNAL(customCommand(QString,QStringList)), this, SLOT(onCustomCommand(QString,QStringList)));

    d.topicLabel->setVisible(type == ChannelView);
    d.listView->setVisible(type == ChannelView);
    if (type == ChannelView)
    {
        d.listView->setSession(session);
        connect(d.listView, SIGNAL(queried(QString)), this, SIGNAL(queried(QString)));
        connect(d.listView, SIGNAL(doubleClicked(QString)), this, SIGNAL(queried(QString)));
        connect(d.listView, SIGNAL(commandRequested(IrcCommand*)), d.session, SLOT(sendCommand(IrcCommand*)));
    }
Beispiel #3
0
bool Transfer::executeCustomCommands() {
    Logger::log("Transfer::executeCustomCommands()", Logger::LowVerbosity);
    m_commands.clear();
    QString command = customCommand();
    const QString defaultCommand = Settings::customTransferCommand();
    const bool defaultEnabled = (!defaultCommand.isEmpty()) && (Settings::customTransferCommandEnabled());

    if (!command.isEmpty()) {
        const QString workingDirectory = downloadPath();
        command.replace("%f", fileName());
        m_commands << Command(workingDirectory, command);
        Logger::log(QString("Transfer::executeCustomCommands(): Adding custom command: Working directory: %1, Command: %2")
                           .arg(workingDirectory).arg(command), Logger::LowVerbosity);
    }
    
    if ((defaultEnabled) && ((command.isEmpty()) || (!customCommandOverrideEnabled()))) {
        const QString workingDirectory = downloadPath();
        command = defaultCommand;
        command.replace("%f", fileName());
        m_commands << Command(workingDirectory, command);
        Logger::log(QString("Transfer::executeCustomCommands(): Adding custom command: Working directory: %1, Command: %2")
                           .arg(workingDirectory).arg(command), Logger::LowVerbosity);
    }
    
    if (!m_commands.isEmpty()) {
        setStatus(ExecutingCustomCommand);
        executeCustomCommand(m_commands.takeFirst());
        return true;
    }
    
    return false;
}
Beispiel #4
0
int CurlFtp::customCommandWithResponseText(QString cmdLine, long &respCode, QByteArray &respText)
{
    int rc = customCommand(cmdLine, respCode);
    
    respText = this->rawRespBuff.data();
    this->rawRespBuff.setData(NULL, 0);
    qDebug()<<"abtained22222:"<<this->rawRespBuff.data()<<respText;
    return rc;
}
bool CustomCommandService::down(const Commands::ConstCommandPtr &command, CommandExecution::CommandExecutionContext &context) const
{
    if(!command) {
        ::qDebug() << LOG_PREFIX << Q_FUNC_INFO << "command is 0!";
        return false;
    }

    QSharedPointer<const Commands::CustomCommandBase> customCommand(command.staticCast<const Commands::CustomCommandBase>());

    if(!customCommand) {
        ::qDebug() << LOG_PREFIX << Q_FUNC_INFO << "customCommand is 0!";
        return false;
    }

    return customCommand->down(context.database());
}
Beispiel #6
0
void Transfer::setCustomCommand(const QString &c) {
    if (c != customCommand()) {
        m_customCommand = c;
        emit customCommandChanged();
    }
}