Esempio n. 1
0
    QStringList formats() const
    {
        QStringList result;

        Q_FOREACH (const QString &format, m_formatsToCheck) {
            if (is_clipboard_format_present(format.toUtf8().constData()) == 0)
                result << format;
        }

        qClipboardDebug() << Q_FUNC_INFO << "result=" << result;
        return result;
    }
Esempio n. 2
0
static QByteArray readClipboardBuff(const char *type)
{
    char *pbuffer;
    if (is_clipboard_format_present(type) == 0) {
        int size = get_clipboard_data(type, &pbuffer);
        if (size != -1 && pbuffer) {
            const QByteArray result = QByteArray(pbuffer, size);
            free(pbuffer);
            return result;
        }
    }

    return QByteArray();
}
Esempio n. 3
0
void QBBClipboard::readClipboardBuff(const char *type)
{
    char *pbuffer;
    if (is_clipboard_format_present(type) == 0) {
        get_clipboard_data(type, &pbuffer);
        if (pbuffer) {
            QString qtype = type;
#if defined(QBBCLIPBOARD_DEBUG)
            qDebug() << "QBB: clipboard has " << qtype;
#endif
            mMimeData->setData(qtype, pbuffer);
            delete pbuffer;
        }
    }
}
Esempio n. 4
0
 bool hasFormat(const QString &mimetype) const
 {
     const bool result = is_clipboard_format_present(mimetype.toUtf8().constData()) == 0;
     qClipboardDebug() << Q_FUNC_INFO << "mimetype=" << mimetype << "result=" << result;
     return result;
 }