Pārlūkot izejas kodu

Script binding for QIODevice::open() no longer eats return value

Neal Wilson 10 gadus atpakaļ
vecāks
revīzija
5b3e2e3604
1 mainītis faili ar 6 papildinājumiem un 5 dzēšanām
  1. 6
    5
      src/typica.w

+ 6
- 5
src/typica.w Parādīt failu

@@ -1937,18 +1937,19 @@ not passed, it is assumed that the user wants read and write access.
1937 1937
 QScriptValue QIODevice_open(QScriptContext *context, QScriptEngine *)
1938 1938
 {
1939 1939
 	QIODevice *self = getself<QIODevice *>(context);
1940
+	bool retval = false;
1940 1941
 	if(context->argumentCount() == 1)
1941 1942
 	{
1942 1943
 		switch(argument<int>(0, context))
1943 1944
 		{
1944 1945
 			case 1:
1945
-				self->open(QIODevice::ReadOnly);
1946
+				retval = self->open(QIODevice::ReadOnly);
1946 1947
 				break;
1947 1948
 			case 2:
1948
-				self->open(QIODevice::WriteOnly);
1949
+				retval = self->open(QIODevice::WriteOnly);
1949 1950
 				break;
1950 1951
 			case 3:
1951
-				self->open(QIODevice::ReadWrite);
1952
+				retval = self->open(QIODevice::ReadWrite);
1952 1953
 				break;
1953 1954
 			default:
1954 1955
 				break;
@@ -1956,9 +1957,9 @@ QScriptValue QIODevice_open(QScriptContext *context, QScriptEngine *)
1956 1957
 	}
1957 1958
 	else
1958 1959
 	{
1959
-		self->open(QIODevice::ReadWrite);
1960
+		retval = self->open(QIODevice::ReadWrite);
1960 1961
 	}
1961
-	return QScriptValue();
1962
+	return QScriptValue(retval);
1962 1963
 }
1963 1964
 
1964 1965
 QScriptValue QIODevice_close(QScriptContext *context, QScriptEngine *)

Notiek ielāde…
Atcelt
Saglabāt