Include the code that we need

- `cin` and `cout` require iostream.
- `QT_VERSION` requires QtGlobal.
- `QSocketNotifier` requires QSocketNotifier.
- Unrelated to includes: let Qt figure out the spec.

Found by Jeremy Evans on behalf of the OpenBSD project.
This commit is contained in:
Mike Burns 2015-03-26 18:33:28 +01:00 committed by Matthew Horan
parent 079e6cbca1
commit 0506f24a0a
4 changed files with 6 additions and 30 deletions

View File

@ -16,32 +16,17 @@ module CapybaraWebkitBuilder
ENV['QMAKE'] || default_qmake_binary
end
def spec
ENV['SPEC'] || os_spec
end
def default_qmake_binary
case RbConfig::CONFIG['host_os']
when /freebsd/
"qmake-qt4"
when /openbsd/
"qmake-qt5"
else
"qmake"
end
end
def os_spec
case RbConfig::CONFIG['host_os']
when /linux/
"linux-g++"
when /freebsd/
"freebsd-g++"
when /mingw32/
"win32-g++"
else
"macx-g++"
end
end
def sh(command)
system(command)
success = $?.exitstatus == SUCCESS_STATUS
@ -56,7 +41,7 @@ module CapybaraWebkitBuilder
def makefile(*configs)
configs += default_configs
configs = configs.map { |config| config.shellescape}.join(" ")
sh("#{qmake_bin} -spec #{spec} #{configs}")
sh("#{qmake_bin} #{configs}")
end
def qmake

View File

@ -16,12 +16,6 @@ describe CapybaraWebkitBuilder do
end
end
it "will use the env variable for #os_spec" do
with_env_vars("SPEC" => "fake_os_spec") do
builder.spec.should == "fake_os_spec"
end
end
it "defaults the #make_bin" do
with_env_vars("MAKE_BIN" => nil) do
builder.make_bin.should == 'make'
@ -33,11 +27,5 @@ describe CapybaraWebkitBuilder do
builder.qmake_bin.should == 'qmake'
end
end
it "defaults #spec to the #os_specs" do
with_env_vars("SPEC" => nil) do
builder.spec.should == builder.os_spec
end
end
end

View File

@ -1,6 +1,8 @@
#include "StdinNotifier.h"
#include <QTcpServer>
#include <QSocketNotifier>
#include <iostream>
StdinNotifier::StdinNotifier(QObject *parent) : QObject(parent) {
m_notifier = new QSocketNotifier(fileno(stdin), QSocketNotifier::Read, this);

View File

@ -1,5 +1,6 @@
#ifndef _WEBPAGE_H
#define _WEBPAGE_H
#include <QtGlobal>
#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
#include <QtWebKitWidgets>
#else