Ejemplo n.º 1
0
void WebPage::finished()
{
    progress(100);

    if (m_adjustingScheduled) {
        m_adjustingScheduled = false;
        mainFrame()->setZoomFactor(mainFrame()->zoomFactor() + 1);
        mainFrame()->setZoomFactor(mainFrame()->zoomFactor() - 1);
    }

    // File scheme watcher
    if (url().scheme() == QLatin1String("file")) {
        QFileInfo info(url().toLocalFile());
        if (info.isFile()) {
            if (!m_fileWatcher) {
                m_fileWatcher = new DelayedFileWatcher(this);
                connect(m_fileWatcher, SIGNAL(delayedFileChanged(QString)), this, SLOT(watchedFileChanged(QString)));
            }

            const QString filePath = url().toLocalFile();

            if (QFile::exists(filePath) && !m_fileWatcher->files().contains(filePath)) {
                m_fileWatcher->addPath(filePath);
            }
        }
    }
    else if (m_fileWatcher && !m_fileWatcher->files().isEmpty()) {
        m_fileWatcher->removePaths(m_fileWatcher->files());
    }

    // AdBlock
    cleanBlockedObjects();
}
Ejemplo n.º 2
0
GM_Script::GM_Script(GM_Manager* manager, const QString &filePath)
    : QObject(manager)
    , m_manager(manager)
    , m_fileWatcher(new DelayedFileWatcher(this))
    , m_namespace("GreaseMonkeyNS")
    , m_startAt(DocumentEnd)
    , m_noframes(false)
    , m_fileName(filePath)
    , m_enabled(true)
    , m_valid(false)
    , m_updating(false)
{
    parseScript();

    connect(m_fileWatcher, SIGNAL(delayedFileChanged(QString)), this, SLOT(watchedFileChanged(QString)));
}
Ejemplo n.º 3
0
void AutoFileBackup::fileChanged(const QString &path)
{

    if(!changedFileQueue.contains(path))
    {
        changedFileQueue.append(path);
        addLog("File added to queue",path);
        ui->changedFileQueueList->clear();
        ui->changedFileQueueList->addItems(changedFileQueue);




        //    qDebug() << "before File Copying        " + QTime::currentTime().toString() ;

        QTimer::singleShot( ui->savingTimeDelaySpinBox->value(), this, SLOT(delayedFileChanged()));

        //    qDebug() << "Finished File Copying         " + QTime::currentTime().toString() ;

    }
    else
        addLog("File already in queue",path);
}